X-Git-Url: https://git.saurik.com/apple/libpthread.git/blobdiff_plain/76b7b9a2a65d05f65ded82a6675bf63a7f569766..214d78a2e71d35948bb3c390fec58031c3f0611b:/kern/synch_internal.h diff --git a/kern/synch_internal.h b/kern/synch_internal.h index 6b22c41..1b9d6c2 100644 --- a/kern/synch_internal.h +++ b/kern/synch_internal.h @@ -24,6 +24,12 @@ #ifndef __SYNCH_INTERNAL_H__ #define __SYNCH_INTERNAL_H__ +// kwe_state +enum { + KWE_THREAD_INWAIT = 1, + KWE_THREAD_PREPOST, + KWE_THREAD_BROADCAST, +}; #define _PTHREAD_MTX_OPT_PSHARED 0x010 #define _PTHREAD_MTX_OPT_NOTIFY 0x1000 /* notify to drop mutex handling in cvwait */ @@ -79,8 +85,13 @@ #define is_rwl_readoverlap(x) (((x) & PTH_RWL_MBIT) != 0) // S word tests -#define is_rws_setseq(x) (((x) & PTH_RWS_SBIT)) -#define is_rws_setunlockinit(x) (((x) & PTH_RWS_IBIT)) +#define is_rws_sbit_set(x) (((x) & PTH_RWS_SBIT) != 0) +#define is_rws_unlockinit_set(x) (((x) & PTH_RWS_IBIT) != 0) +#define is_rws_savemask_set(x) (((x) & PTHRW_RWS_SAVEMASK) != 0) +#define is_rws_pbit_set(x) (((x) & PTH_RWS_CV_PBIT) != 0) + +// kwe_flags +#define KWE_FLAG_LOCKPREPOST 0x1 // cvwait caused a lock prepost static inline int is_seqlower(uint32_t x, uint32_t y)