ck_bytelock: Fix casting error affecting 32-bit architectures.

ck_pring
Samy Al Bahra 11 years ago
parent 81f267ce62
commit 671d067ea0

@ -81,8 +81,8 @@ ck_bytelock_init(struct ck_bytelock *bytelock)
CK_CC_INLINE static void CK_CC_INLINE static void
ck_bytelock_write_lock(struct ck_bytelock *bytelock, unsigned int slot) ck_bytelock_write_lock(struct ck_bytelock *bytelock, unsigned int slot)
{ {
CK_BYTELOCK_TYPE *readers = (void *)bytelock->readers;
unsigned int i; unsigned int i;
uint64_t *readers = (void *)bytelock->readers;
/* Announce upcoming writer acquisition. */ /* Announce upcoming writer acquisition. */
while (ck_pr_cas_uint(&bytelock->owner, 0, slot) == false) while (ck_pr_cas_uint(&bytelock->owner, 0, slot) == false)
@ -95,7 +95,7 @@ ck_bytelock_write_lock(struct ck_bytelock *bytelock, unsigned int slot)
/* Wait for slotted readers to drain out. */ /* Wait for slotted readers to drain out. */
ck_pr_fence_store_load(); ck_pr_fence_store_load();
for (i = 0; i < sizeof(bytelock->readers) / CK_BYTELOCK_LENGTH; i++) { for (i = 0; i < sizeof(bytelock->readers) / CK_BYTELOCK_LENGTH; i++) {
while (CK_BYTELOCK_LOAD((CK_BYTELOCK_TYPE *)&readers[i]) != false) while (CK_BYTELOCK_LOAD(&readers[i]) != false)
ck_pr_stall(); ck_pr_stall();
} }

Loading…
Cancel
Save