You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ck/regressions/ck_spinlock/ck_clh.h

9 lines
407 B

14 years ago
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define LOCK_NAME "ck_clh"
#define LOCK_DEFINE static ck_spinlock_clh_t CK_CC_CACHELINE *lock = NULL
#define LOCK_STATE ck_spinlock_clh_t *na = malloc(MAX(sizeof(ck_spinlock_clh_t), 64))
#define LOCK ck_spinlock_clh_lock(&lock, na)
#define UNLOCK ck_spinlock_clh_unlock(&na)
#define LOCK_INIT ck_spinlock_clh_init(&lock, malloc(MAX(sizeof(ck_spinlock_clh_t), 64)))