diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-13 15:14:40 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-16 01:58:33 +0100 |
commit | c8f9421298f5f973b31a7cbbc76e61b06eca03bc (patch) | |
tree | 86bf4c058624d76b6e35fd44f1f506c3ad9b3d94 /sysdeps/htl/bits | |
parent | 644d98ec4d8405e9b721ecb715483ea1983e116f (diff) | |
download | glibc-c8f9421298f5f973b31a7cbbc76e61b06eca03bc.tar.gz glibc-c8f9421298f5f973b31a7cbbc76e61b06eca03bc.tar.xz glibc-c8f9421298f5f973b31a7cbbc76e61b06eca03bc.zip |
htl: Add pshared semaphore support
The implementation is extremely similar to the nptl implementation, but with slight differences in the futex interface. This fixes some of BZ 25521.
Diffstat (limited to 'sysdeps/htl/bits')
-rw-r--r-- | sysdeps/htl/bits/semaphore.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sysdeps/htl/bits/semaphore.h b/sysdeps/htl/bits/semaphore.h index 8611bac5ce..77a2be13d3 100644 --- a/sysdeps/htl/bits/semaphore.h +++ b/sysdeps/htl/bits/semaphore.h @@ -27,21 +27,15 @@ #include <bits/pthread.h> /* User visible part of a semaphore. */ -struct __semaphore -{ - __pthread_spinlock_t __lock; - struct __pthread *__queue; - int __pshared; - int __value; - void *__data; -}; -typedef struct __semaphore sem_t; +#define __SIZEOF_SEM_T 20 -#define SEM_FAILED ((void *) 0) +typedef union +{ + char __size[__SIZEOF_SEM_T]; + long int __align; +} sem_t; -/* Initializer for a semaphore. */ -#define __SEMAPHORE_INITIALIZER(pshared, value) \ - { __PTHREAD_SPIN_LOCK_INITIALIZER, NULL, (pshared), (value), NULL } +#define SEM_FAILED ((void *) 0) #endif /* bits/semaphore.h */ |