]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/atomic.h
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2011 RedHat, Inc.
10 * Warning: These are not really atomic at all. They are wrappers around the
11 * kernel atomic variable interface. If we do need these variables to be atomic
12 * (due to multithreading of the code that uses them) we need to add some
13 * pthreads magic here.
15 typedef int32_t atomic_t
;
16 typedef int64_t atomic64_t
;
18 #define atomic_inc_return(x) (++(*(x)))
19 #define atomic_dec_return(x) (--(*(x)))
21 #define atomic64_read(x) *(x)
22 #define atomic64_set(x, v) (*(x) = v)
24 #endif /* __ATOMIC_H__ */