XenevaOS
Loading...
Searching...
No Matches
Classes | Macros
atomic.h File Reference
#include <stdbool.h>
Include dependency graph for atomic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  atomic_t
 
struct  atomic64_t
 
struct  atomic_long_t
 

Macros

#define ATOMIC_INIT(i)   { (i) }
 
#define ATOMIC64_INIT(i)   { (i) }
 
#define ATOMIC_LONG_INIT(i)   { (i) }
 
#define cmpxchg(ptr, old, new)
 

Macro Definition Documentation

◆ ATOMIC64_INIT

#define ATOMIC64_INIT (   i)    { (i) }

◆ ATOMIC_INIT

#define ATOMIC_INIT (   i)    { (i) }

◆ ATOMIC_LONG_INIT

#define ATOMIC_LONG_INIT (   i)    { (i) }

◆ cmpxchg

#define cmpxchg (   ptr,
  old,
  new 
)
Value:
({ \
typeof(*(ptr)) __old = (old); \
typeof(*(ptr)) __new = (new); \
(void)__atomic_compare_exchange_n((ptr), &__old, __new, 0, \
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
__old; \
})