Haka: Atomic counter

Haka

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Functions
Atomic counter

## Typedefs
typedef volatile uint32 | atomic_t
typedef volatile uint64 | atomic64_t

## Functions
INLINE uint32 | atomic_inc (atomic_t *v)
INLINE uint32 | atomic_dec (atomic_t *v)
INLINE uint32 | atomic_get (atomic_t *v)
INLINE void | atomic_set (atomic_t *v, uint32 x)
INLINE void | atomic64_set (atomic64_t *v, uint64 x)
INLINE void | atomic64_init (atomic64_t *v, uint64 x)
INLINE void | atomic64_destroy (atomic64_t *v)
INLINE uint64 | atomic64_inc (atomic64_t *v)
INLINE uint64 | atomic64_dec (atomic64_t *v)
INLINE uint64 | atomic64_get (atomic64_t *v)

## Detailed Description

## Typedef Documentation

typedef volatile uint64 atomic64_t

64 bit atomic opaque type.

typedef volatile uint32 atomic_t

32 bit atomic opaque type.

## Function Documentation

INLINE uint64 atomic64_dec | ( | atomic64_t * | v | ) |

Decrement a 64 bit atomic counter.

Returns
  The new value after decrement.

INLINE void atomic64_destroy | ( | atomic64_t * | v | ) |

Destroy a 64 bit atomic counter.

INLINE uint64 atomic64_get | ( | atomic64_t * | v | ) |

Get the value of a 64 bit atomic counter.

INLINE uint64 atomic64_inc | ( | atomic64_t * | v | ) |

Increment a 64 bit atomic counter.

Returns
  The new value after increment.

INLINE void atomic64_init | ( | atomic64_t * | v,
|  | uint64 | x
| ) |  |

Initialize a 64 bit atomic counter.

INLINE void atomic64_set | ( | atomic64_t * | v,
|  | uint64 | x
| ) |  |

Set the current value of a 64 bit atomic counter.

INLINE uint32 atomic_dec | ( | atomic_t * | v | ) |

Decrement an atomic counter.

Returns
  The new value after decrement.

INLINE uint32 atomic_get | ( | atomic_t * | v | ) |

Get the value of an atomic counter.

INLINE uint32 atomic_inc | ( | atomic_t * | v | ) |

Increment an atomic counter.

Returns
  The new value after increment.

INLINE void atomic_set | ( | atomic_t * | v,
|  | uint32 | x
| ) |  |

Set the current value of an atomic counter.