summaryrefslogtreecommitdiff
path: root/kern/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.h')
-rw-r--r--kern/thread.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/kern/thread.h b/kern/thread.h
index 3fa2a1f8..ee58c43f 100644
--- a/kern/thread.h
+++ b/kern/thread.h
@@ -270,7 +270,7 @@ thread_ref(struct thread *thread)
{
unsigned long nr_refs;
- nr_refs = atomic_fetch_add(&thread->nr_refs, 1, ATOMIC_SEQ_CST);
+ nr_refs = atomic_fetch_add(&thread->nr_refs, 1, ATOMIC_RELAXED);
assert(nr_refs != (unsigned long)-1);
}
@@ -279,7 +279,7 @@ thread_unref(struct thread *thread)
{
unsigned long nr_refs;
- nr_refs = atomic_fetch_sub(&thread->nr_refs, 1, ATOMIC_SEQ_CST);
+ nr_refs = atomic_fetch_sub_acq_rel(&thread->nr_refs, 1);
assert(nr_refs != 0);
if (nr_refs == 1) {