xref: /aosp_15_r20/external/musl/src/thread/pthread_cond_init.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1*c9945492SAndroid Build Coastguard Worker #include "pthread_impl.h"
2*c9945492SAndroid Build Coastguard Worker 
pthread_cond_init(pthread_cond_t * restrict c,const pthread_condattr_t * restrict a)3*c9945492SAndroid Build Coastguard Worker int pthread_cond_init(pthread_cond_t *restrict c, const pthread_condattr_t *restrict a)
4*c9945492SAndroid Build Coastguard Worker {
5*c9945492SAndroid Build Coastguard Worker 	*c = (pthread_cond_t){0};
6*c9945492SAndroid Build Coastguard Worker 	if (a) {
7*c9945492SAndroid Build Coastguard Worker 		c->_c_clock = a->__attr & 0x7fffffff;
8*c9945492SAndroid Build Coastguard Worker 		if (a->__attr>>31) c->_c_shared = (void *)-1;
9*c9945492SAndroid Build Coastguard Worker 	}
10*c9945492SAndroid Build Coastguard Worker 	return 0;
11*c9945492SAndroid Build Coastguard Worker }
12