ck_bytelock: read_lock must serialize all load/store before checking owner field.

Thanks to Andrew Schorr for reporting the unit test failure.
ck_pring
Samy Al Bahra 12 years ago
parent 3afa6b2b39
commit fbb88a519c

@ -148,7 +148,7 @@ ck_bytelock_read_lock(struct ck_bytelock *bytelock, unsigned int slot)
slot -= 1; slot -= 1;
for (;;) { for (;;) {
ck_pr_store_8(&bytelock->readers[slot], true); ck_pr_store_8(&bytelock->readers[slot], true);
ck_pr_fence_strict_store(); ck_pr_fence_strict_memory();
/* /*
* If there is no owner at this point, our slot has * If there is no owner at this point, our slot has

Loading…
Cancel
Save