xref: /aosp_15_r20/external/musl/src/thread/pthread_rwlock_init.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1*c9945492SAndroid Build Coastguard Worker #include "pthread_impl.h"
2*c9945492SAndroid Build Coastguard Worker 
pthread_rwlock_init(pthread_rwlock_t * restrict rw,const pthread_rwlockattr_t * restrict a)3*c9945492SAndroid Build Coastguard Worker int pthread_rwlock_init(pthread_rwlock_t *restrict rw, const pthread_rwlockattr_t *restrict a)
4*c9945492SAndroid Build Coastguard Worker {
5*c9945492SAndroid Build Coastguard Worker 	*rw = (pthread_rwlock_t){0};
6*c9945492SAndroid Build Coastguard Worker 	if (a) rw->_rw_shared = a->__attr[0]*128;
7*c9945492SAndroid Build Coastguard Worker 	return 0;
8*c9945492SAndroid Build Coastguard Worker }
9