xref: /aosp_15_r20/external/musl/src/thread/mtx_unlock.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1*c9945492SAndroid Build Coastguard Worker #include <threads.h>
2*c9945492SAndroid Build Coastguard Worker #include <pthread.h>
3*c9945492SAndroid Build Coastguard Worker 
mtx_unlock(mtx_t * mtx)4*c9945492SAndroid Build Coastguard Worker int mtx_unlock(mtx_t *mtx)
5*c9945492SAndroid Build Coastguard Worker {
6*c9945492SAndroid Build Coastguard Worker 	/* The only cases where pthread_mutex_unlock can return an
7*c9945492SAndroid Build Coastguard Worker 	 * error are undefined behavior for C11 mtx_unlock, so we can
8*c9945492SAndroid Build Coastguard Worker 	 * assume it does not return an error and simply tail call. */
9*c9945492SAndroid Build Coastguard Worker 	return __pthread_mutex_unlock((pthread_mutex_t *)mtx);
10*c9945492SAndroid Build Coastguard Worker }
11