diff --git a/misc.h b/misc.h index d71c4a864d..f0ae02330b 100644 --- a/misc.h +++ b/misc.h @@ -32,7 +32,6 @@ #define must_check __attribute__((warn_unused_result)) // types -// word_t will be 64-bit to read 64-bit elves typedef uint64_t qword_t; typedef uint32_t dword_t; typedef int32_t sdword_t; @@ -46,4 +45,9 @@ typedef sdword_t int_t; #define uint(size) CONCAT3(uint,size,_t) #define sint(size) CONCAT3(int,size,_t) +#define lock(thing) pthread_mutex_lock(&(thing)->lock) +#define unlock(thing) pthread_mutex_unlock(&(thing)->lock) +#define wait_for(thing, what) pthread_cond_wait(&(thing)->what, &(thing)->lock) +#define signal(thing, what) pthread_cond_broadcast(&(thing)->what) + #endif