Skip to content

Commit

Permalink
libutils: atomic.h: add atomic_{load,store}_short()
Browse files Browse the repository at this point in the history
Adds atomic functions operating on the 'short int' type.

Signed-off-by: Jerome Forissier <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
jforissier committed Jul 14, 2020
1 parent 3f7a0ba commit 64fd5a9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/libutils/ext/include/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ static inline int atomic_load_int(int *p)
return __compiler_atomic_load(p);
}

static inline short int atomic_load_short(short int *p)
{
return __compiler_atomic_load(p);
}

static inline unsigned int atomic_load_uint(unsigned int *p)
{
return __compiler_atomic_load(p);
Expand All @@ -43,6 +48,11 @@ static inline void atomic_store_int(int *p, int val)
__compiler_atomic_store(p, val);
}

static inline void atomic_store_short(short int *p, short int val)
{
__compiler_atomic_store(p, val);
}

static inline void atomic_store_uint(unsigned int *p, unsigned int val)
{
__compiler_atomic_store(p, val);
Expand Down

0 comments on commit 64fd5a9

Please sign in to comment.