regressions: Add ck_spinlock locked coverage.

ck_pring
Samy Al Bahra 12 years ago
parent a51c8c7aa6
commit 143bc4b336

@ -5,6 +5,7 @@
#define LOCK ck_spinlock_anderson_lock(&lock, &nad)
#define UNLOCK ck_spinlock_anderson_unlock(&lock, nad)
#define LOCK_INIT ck_spinlock_anderson_init(&lock, malloc(MAX(64,sizeof(ck_spinlock_anderson_thread_t)) * nthr), nthr)
#define LOCKED ck_spinlock_anderson_locked(&lock)
#define NO_LOCAL

@ -2,4 +2,5 @@
#define LOCK_DEFINE static ck_spinlock_cas_t CK_CC_CACHELINE lock = CK_SPINLOCK_CAS_INITIALIZER
#define LOCK ck_spinlock_cas_lock_eb(&lock)
#define UNLOCK ck_spinlock_cas_unlock(&lock)
#define LOCKED ck_spinlock_cas_locked(&lock)

@ -5,4 +5,5 @@
#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)

@ -2,4 +2,5 @@
#define LOCK_DEFINE static ck_spinlock_dec_t CK_CC_CACHELINE lock = CK_SPINLOCK_DEC_INITIALIZER
#define LOCK ck_spinlock_dec_lock_eb(&lock)
#define UNLOCK ck_spinlock_dec_unlock(&lock)
#define LOCKED ck_spinlock_dec_locked(&lock)

@ -2,4 +2,5 @@
#define LOCK_DEFINE static ck_spinlock_fas_t CK_CC_CACHELINE lock = CK_SPINLOCK_FAS_INITIALIZER
#define LOCK ck_spinlock_fas_lock_eb(&lock)
#define UNLOCK ck_spinlock_fas_unlock(&lock)
#define LOCKED ck_spinlock_fas_locked(&lock)

@ -3,4 +3,5 @@
#define LOCK_STATE ck_spinlock_mcs_context_t node CK_CC_CACHELINE;
#define LOCK ck_spinlock_mcs_lock(&lock, &node)
#define UNLOCK ck_spinlock_mcs_unlock(&lock, &node)
#define LOCKED ck_spinlock_mcs_locked(&lock)

@ -2,4 +2,5 @@
#define LOCK_DEFINE static ck_spinlock_t CK_CC_CACHELINE lock = CK_SPINLOCK_INITIALIZER
#define LOCK ck_spinlock_lock_eb(&lock)
#define UNLOCK ck_spinlock_unlock(&lock)
#define LOCKED ck_spinlock_locked(&lock)

@ -7,4 +7,5 @@
#ifdef CK_F_SPINLOCK_TICKET_TRYLOCK
#define TRYLOCK ck_spinlock_ticket_trylock(&lock)
#endif
#define LOCKED ck_spinlock_ticket_locked(&lock)

@ -2,4 +2,5 @@
#define LOCK_DEFINE static ck_spinlock_ticket_t CK_CC_CACHELINE lock = CK_SPINLOCK_TICKET_INITIALIZER
#define LOCK ck_spinlock_ticket_lock_pb(&lock, 0)
#define UNLOCK ck_spinlock_ticket_unlock(&lock)
#define LOCKED ck_spinlock_ticket_locked(&lock)

@ -81,6 +81,11 @@ thread(void *null CK_CC_UNUSED)
LOCK;
#endif
#ifdef LOCKED
if (LOCKED == false)
ck_error("is_locked operation failed.");
#endif
ck_pr_inc_uint(&locked);
ck_pr_inc_uint(&locked);
ck_pr_inc_uint(&locked);

Loading…
Cancel
Save