|
|
|
@ -93,7 +93,7 @@ ck_bytelock_write_lock(struct ck_bytelock *bytelock, unsigned int slot)
|
|
|
|
|
ck_pr_store_8(&bytelock->readers[slot - 1], false);
|
|
|
|
|
|
|
|
|
|
/* Wait for slotted readers to drain out. */
|
|
|
|
|
ck_pr_fence_strict_memory();
|
|
|
|
|
ck_pr_fence_store_load();
|
|
|
|
|
for (i = 0; i < sizeof(bytelock->readers) / CK_BYTELOCK_LENGTH; i++) {
|
|
|
|
|
while (CK_BYTELOCK_LOAD((CK_BYTELOCK_TYPE *)&readers[i]) != false)
|
|
|
|
|
ck_pr_stall();
|
|
|
|
@ -150,7 +150,7 @@ ck_bytelock_read_lock(struct ck_bytelock *bytelock, unsigned int slot)
|
|
|
|
|
slot -= 1;
|
|
|
|
|
for (;;) {
|
|
|
|
|
ck_pr_store_8(&bytelock->readers[slot], true);
|
|
|
|
|
ck_pr_fence_strict_memory();
|
|
|
|
|
ck_pr_fence_store_load();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* If there is no owner at this point, our slot has
|
|
|
|
|