xref: /aosp_15_r20/external/musl/src/thread/pthread_mutex_destroy.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1*c9945492SAndroid Build Coastguard Worker #include "pthread_impl.h"
2*c9945492SAndroid Build Coastguard Worker 
pthread_mutex_destroy(pthread_mutex_t * mutex)3*c9945492SAndroid Build Coastguard Worker int pthread_mutex_destroy(pthread_mutex_t *mutex)
4*c9945492SAndroid Build Coastguard Worker {
5*c9945492SAndroid Build Coastguard Worker 	/* If the mutex being destroyed is process-shared and has nontrivial
6*c9945492SAndroid Build Coastguard Worker 	 * type (tracking ownership), it might be in the pending slot of a
7*c9945492SAndroid Build Coastguard Worker 	 * robust_list; wait for quiescence. */
8*c9945492SAndroid Build Coastguard Worker 	if (mutex->_m_type > 128) __vm_wait();
9*c9945492SAndroid Build Coastguard Worker 	return 0;
10*c9945492SAndroid Build Coastguard Worker }
11