diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2025-03-22 18:00:25 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2025-03-22 18:00:25 +0100 |
commit | 0737819efdd0bae112d16d874cac7e747e43cd08 (patch) | |
tree | 98a9ac84f7f347ae530c14852c68870682f3d04c /lib/glthread/lock.c | |
parent | 163a663518f33bab48b28431972e580b366b4d49 (diff) | |
parent | e670957a8693f860cf7d77fed4ce6b4b056a8083 (diff) |
Merge branch 'release/debian/1.3-1'debian/1.3-1
Diffstat (limited to 'lib/glthread/lock.c')
-rw-r--r-- | lib/glthread/lock.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c index 6661ad6a..40b2a5ee 100644 --- a/lib/glthread/lock.c +++ b/lib/glthread/lock.c @@ -240,8 +240,6 @@ glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) return 0; } -/* -------------------------- gl_once_t datatype -------------------------- */ - #endif /* ========================================================================= */ @@ -698,46 +696,6 @@ glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) # endif -/* -------------------------- gl_once_t datatype -------------------------- */ - -static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT; - -int -glthread_once_singlethreaded (pthread_once_t *once_control) -{ - /* We don't know whether pthread_once_t is an integer type, a floating-point - type, a pointer type, or a structure type. */ - char *firstbyte = (char *)once_control; - if (*firstbyte == *(const char *)&fresh_once) - { - /* First time use of once_control. Invert the first byte. */ - *firstbyte = ~ *(const char *)&fresh_once; - return 1; - } - else - return 0; -} - -# if !(PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK) - -int -glthread_once_multithreaded (pthread_once_t *once_control, - void (*init_function) (void)) -{ - int err = pthread_once (once_control, init_function); - if (err == ENOSYS) - { - /* This happens on FreeBSD 11: The pthread_once function in libc returns - ENOSYS. */ - if (glthread_once_singlethreaded (once_control)) - init_function (); - return 0; - } - return err; -} - -# endif - #endif /* ========================================================================= */ |