1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20: #include <shlib-compat.h>
21: #include "pthreadP.h"
22:
23:
24: int
25: __pthread_cond_init (cond, cond_attr)
26: pthread_cond_t *cond;
27: const pthread_condattr_t *cond_attr;
28: {
29: struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr;
30:
31: cond->__data.__lock = LLL_LOCK_INITIALIZER;
32: cond->__data.__futex = 0;
33: cond->__data.__nwaiters = (icond_attr != NULL
34: && ((icond_attr->value
35: & (COND_NWAITERS_SHIFT << 1)) >> 1));
36: cond->__data.__total_seq = 0;
37: cond->__data.__wakeup_seq = 0;
38: cond->__data.__woken_seq = 0;
39: cond->__data.__mutex = (icond_attr == NULL || (icond_attr->value & 1) == 0
40: ? NULL : (void *) ~0l);
41: cond->__data.__broadcast_seq = 0;
42:
43: return 0;
44: }
45: versioned_symbol (libpthread, __pthread_cond_init,
46: pthread_cond_init, GLIBC_2_3_2);