12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #include "pthreadP.h"
- int
- attribute_protected
- __pthread_cond_init (
- pthread_cond_t *cond,
- const pthread_condattr_t *cond_attr)
- {
- struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr;
- cond->__data.__lock = LLL_LOCK_INITIALIZER;
- cond->__data.__futex = 0;
- cond->__data.__nwaiters = (icond_attr != NULL
- ? ((icond_attr->value >> 1)
- & ((1 << COND_NWAITERS_SHIFT) - 1))
- : CLOCK_REALTIME);
- cond->__data.__total_seq = 0;
- cond->__data.__wakeup_seq = 0;
- cond->__data.__woken_seq = 0;
- cond->__data.__mutex = (icond_attr == NULL || (icond_attr->value & 1) == 0
- ? NULL : (void *) ~0l);
- cond->__data.__broadcast_seq = 0;
- return 0;
- }
- weak_alias(__pthread_cond_init, pthread_cond_init)
|