*lock: Simply use compiler barrier on initialization.

ck_pring
Samy Al Bahra 11 years ago
parent b24a9af88a
commit f3539396c2

@ -67,7 +67,7 @@ ck_brlock_init(struct ck_brlock *br)
br->readers = NULL; br->readers = NULL;
br->writer = false; br->writer = false;
ck_pr_fence_store(); ck_pr_barrier();
return; return;
} }

@ -62,7 +62,7 @@ ck_bytelock_init(struct ck_bytelock *bytelock)
for (i = 0; i < sizeof bytelock->readers; i++) for (i = 0; i < sizeof bytelock->readers; i++)
bytelock->readers[i] = false; bytelock->readers[i] = false;
ck_pr_fence_store(); ck_pr_barrier();
return; return;
} }

@ -46,7 +46,7 @@ ck_rwlock_init(struct ck_rwlock *rw)
rw->writer = 0; rw->writer = 0;
rw->n_readers = 0; rw->n_readers = 0;
ck_pr_fence_store(); ck_pr_barrier();
return; return;
} }

@ -74,6 +74,7 @@ ck_tflock_ticket_init(struct ck_tflock_ticket *pf)
{ {
pf->request = pf->completion = 0; pf->request = pf->completion = 0;
ck_pr_barrier();
return; return;
} }

Loading…
Cancel
Save