123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include <errno.h>
- #include "pthreadP.h"
- int
- __pthread_cond_destroy (cond)
- pthread_cond_t *cond;
- {
-
- lll_mutex_lock (cond->__data.__lock);
- if (cond->__data.__total_seq > cond->__data.__wakeup_seq)
- {
-
- lll_mutex_unlock (cond->__data.__lock);
- return EBUSY;
- }
-
- cond->__data.__total_seq = -1ULL;
-
- unsigned int nwaiters = cond->__data.__nwaiters;
- while (nwaiters >= (1 << COND_CLOCK_BITS))
- {
- lll_mutex_unlock (cond->__data.__lock);
- lll_futex_wait (&cond->__data.__nwaiters, nwaiters);
- lll_mutex_lock (cond->__data.__lock);
- nwaiters = cond->__data.__nwaiters;
- }
- return 0;
- }
- versioned_symbol (libpthread, __pthread_cond_destroy,
- pthread_cond_destroy, GLIBC_2_3_2);
|