| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/devel/gettext-tools/files/ |
Upload File : |
--- gnulib-lib/glthread/threadlib.c.orig 2014-07-14 07:28:34 UTC
+++ gnulib-lib/glthread/threadlib.c
@@ -29,11 +29,10 @@
# if PTHREAD_IN_USE_DETECTION_HARD
-/* The function to be executed by a dummy thread. */
-static void *
-dummy_thread_func (void *arg)
+static pthread_once_t dummy_once_control = PTHREAD_ONCE_INIT;
+static void
+dummy_once_func (void)
{
- return arg;
}
int
@@ -44,19 +43,10 @@ glthread_in_use (void)
if (!tested)
{
- pthread_t thread;
-
- if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
- /* Thread creation failed. */
+ if (pthread_once (&dummy_once_control, dummy_once_func) != 0)
result = 0;
else
- {
- /* Thread creation works. */
- void *retval;
- if (pthread_join (thread, &retval) != 0)
- abort ();
- result = 1;
- }
+ result = 1;
tested = 1;
}
return result;