1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #include <pthread.h>
5 
6 #include "macro.h"
7 
pthread_mutex_lock_assert(pthread_mutex_t * mutex)8 static inline pthread_mutex_t* pthread_mutex_lock_assert(pthread_mutex_t *mutex) {
9         assert_se(pthread_mutex_lock(mutex) == 0);
10         return mutex;
11 }
12 
pthread_mutex_unlock_assertp(pthread_mutex_t ** mutexp)13 static inline void pthread_mutex_unlock_assertp(pthread_mutex_t **mutexp) {
14         if (*mutexp)
15                 assert_se(pthread_mutex_unlock(*mutexp) == 0);
16 }
17