regression: fix ck_hclh regression test.

When defining the LOCK macro, make sure we calculate the index for the
local_lock right, core % (CORES / 2) sounds way better than (core % CORES) / 2,
especially when CORES is an odd number.

This should fix github issue #153.
awsm
Olivier Houchard 5 years ago committed by Olivier Houchard
parent bc608c1d7c
commit 7bbced66ad

@ -10,7 +10,7 @@
static ck_spinlock_hclh_t CK_CC_CACHELINE *local_lock[CORES / 2] static ck_spinlock_hclh_t CK_CC_CACHELINE *local_lock[CORES / 2]
#define LOCK_STATE ck_spinlock_hclh_t *na = malloc(MAX(sizeof(ck_spinlock_hclh_t), 64)) #define LOCK_STATE ck_spinlock_hclh_t *na = malloc(MAX(sizeof(ck_spinlock_hclh_t), 64))
#define LOCK ck_spinlock_hclh_lock(&glob_lock, &local_lock[(core % CORES) / 2], na) #define LOCK ck_spinlock_hclh_lock(&glob_lock, &local_lock[core % (CORES / 2)], na)
#define UNLOCK ck_spinlock_hclh_unlock(&na) #define UNLOCK ck_spinlock_hclh_unlock(&na)
#define LOCK_INIT do { \ #define LOCK_INIT do { \
int _i; \ int _i; \

Loading…
Cancel
Save