Removed
Link Here
|
1 |
--- intl/gnulib-lib/glthread/threadlib.c.orig 2023-02-03 13:19:38 UTC |
2 |
+++ intl/gnulib-lib/glthread/threadlib.c |
3 |
@@ -62,11 +62,10 @@ glthread_in_use (void) |
4 |
|
5 |
/* Test using pthread_create. */ |
6 |
|
7 |
-/* The function to be executed by a dummy thread. */ |
8 |
-static void * |
9 |
-dummy_thread_func (void *arg) |
10 |
+static pthread_once_t dummy_once_control = PTHREAD_ONCE_INIT; |
11 |
+static void |
12 |
+dummy_once_func (void) |
13 |
{ |
14 |
- return arg; |
15 |
} |
16 |
|
17 |
int |
18 |
@@ -77,19 +76,10 @@ glthread_in_use (void) |
19 |
|
20 |
if (!tested) |
21 |
{ |
22 |
- pthread_t thread; |
23 |
- |
24 |
- if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0) |
25 |
- /* Thread creation failed. */ |
26 |
+ if (pthread_once (&dummy_once_control, dummy_once_func) != 0) |
27 |
result = 0; |
28 |
else |
29 |
- { |
30 |
- /* Thread creation works. */ |
31 |
- void *retval; |
32 |
- if (pthread_join (thread, &retval) != 0) |
33 |
- abort (); |
34 |
- result = 1; |
35 |
- } |
36 |
+ result = 1; |
37 |
tested = 1; |
38 |
} |
39 |
return result; |