1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <pthread.h> static pthread_mutex_t alarmd_global_lock = PTHREAD_MUTEX_INITIALIZER; int alarmd_lock_destroy() { return pthread_mutex_destroy(&alarmd_global_lock); } int alarmd_lock() { return pthread_mutex_lock(&alarmd_global_lock); } int alarmd_unlock() { return pthread_mutex_unlock(&alarmd_global_lock); }