blob: df7e49fbbdc39b81f5a7d907f3c65ff133d74bb5 (
plain)
1
2
3
4
5
6
7
8
9
|
#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)))
#define LOCKED ck_spinlock_clh_locked(&lock)
|