diff options
author | Richard Braun <rbraun@sceen.net> | 2018-04-21 10:42:11 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-04-21 10:49:07 +0200 |
commit | ec4ddf8b95585cc3e340dd06df109f83a23b2d77 (patch) | |
tree | d70e9c7a52c6c5f60e8d971b0eeb4b275d80bb33 /kern/task.h | |
parent | 89ebd57e0bb3a63f2f794ce41dd4c831b4aeb35c (diff) |
Fix atomic operations argument types
In preparation of the rework of atomic operations, all atomic function
calls are fixed to use fully supported, compatible types. This means
that atomic operations ar erestricted to 32-bit and 64-bit, and that
value types must be strictly compatible with pointer types.
Diffstat (limited to 'kern/task.h')
-rw-r--r-- | kern/task.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kern/task.h b/kern/task.h index d6e9eb44..12e29ac8 100644 --- a/kern/task.h +++ b/kern/task.h @@ -55,7 +55,7 @@ task_ref(struct task *task) { unsigned long nr_refs; - nr_refs = atomic_fetch_add(&task->nr_refs, 1, ATOMIC_RELAXED); + nr_refs = atomic_fetch_add(&task->nr_refs, 1UL, ATOMIC_RELAXED); assert(nr_refs != (unsigned long)-1); } @@ -64,7 +64,7 @@ task_unref(struct task *task) { unsigned long nr_refs; - nr_refs = atomic_fetch_sub(&task->nr_refs, 1, ATOMIC_ACQ_REL); + nr_refs = atomic_fetch_sub(&task->nr_refs, 1UL, ATOMIC_ACQ_REL); assert(nr_refs != 0); if (nr_refs == 1) { |