ck_{rw,byte,br}lock: Serialize final loads with respect to read.

I will switch to a SPARC-style barrier interface.
ck_pring 0.2.8
Samy Al Bahra 12 years ago
parent 86411b9be8
commit e78bbe9ae6

@ -198,6 +198,7 @@ ck_brlock_read_lock(struct ck_brlock *br, struct ck_brlock_reader *reader)
ck_pr_store_uint(&reader->n_readers, 0); ck_pr_store_uint(&reader->n_readers, 0);
} }
ck_pr_fence_load();
return; return;
} }
@ -235,6 +236,7 @@ ck_brlock_read_trylock(struct ck_brlock *br,
return false; return false;
} }
ck_pr_fence_load();
return true; return true;
} }

@ -143,6 +143,7 @@ ck_bytelock_read_lock(struct ck_bytelock *bytelock, unsigned int slot)
ck_pr_stall(); ck_pr_stall();
} }
ck_pr_fence_load();
return; return;
} }

@ -113,6 +113,7 @@ ck_rwlock_read_trylock(ck_rwlock_t *rw)
return false; return false;
leave: leave:
ck_pr_fence_load();
return true; return true;
} }
@ -131,6 +132,7 @@ ck_rwlock_read_lock(ck_rwlock_t *rw)
ck_pr_dec_uint(&rw->n_readers); ck_pr_dec_uint(&rw->n_readers);
} }
ck_pr_fence_load();
return; return;
} }

Loading…
Cancel
Save