reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
lf_atomic.h
Go to the documentation of this file.
1
7#ifndef LF_ATOMICS_H
8#define LF_ATOMICS_H
9
10#include <stdint.h>
11#include <stdbool.h>
12
21int lf_atomic_fetch_add(int* ptr, int val);
22
31int64_t lf_atomic_fetch_add64(int64_t* ptr, int64_t val);
32
41int lf_atomic_add_fetch(int* ptr, int val);
42
51int64_t lf_atomic_add_fetch64(int64_t* ptr, int64_t val);
52
63bool lf_atomic_bool_compare_and_swap(int* ptr, int oldval, int newval);
64
75bool lf_atomic_bool_compare_and_swap64(int64_t* ptr, int64_t oldval, int64_t newval);
76
88int lf_atomic_val_compare_and_swap(int* ptr, int oldval, int newval);
89
101int64_t lf_atomic_val_compare_and_swap64(int64_t* ptr, int64_t oldval, int64_t newval);
102
103#endif
int64_t lf_atomic_val_compare_and_swap64(int64_t *ptr, int64_t oldval, int64_t newval)
Atomically perform a compare-and-swap operation on a 64 bit integer in memory. If the value in memory...
int lf_atomic_fetch_add(int *ptr, int val)
This file defines the LF atomic API. These functions will have platform-dependent implementations.
bool lf_atomic_bool_compare_and_swap64(int64_t *ptr, int64_t oldval, int64_t newval)
Atomically perform a compare-and-swap operation on a 64 bit integer in memory. If the value in memory...
bool lf_atomic_bool_compare_and_swap(int *ptr, int oldval, int newval)
Atomically perform a compare-and-swap operation on a 32 bit integer in memory. If the value in memory...
int lf_atomic_add_fetch(int *ptr, int val)
Atomically fetch an integer from memory and add a value to it. Return the new value of the memory.
int64_t lf_atomic_add_fetch64(int64_t *ptr, int64_t val)
Atomically fetch a 64-bit integer from memory and add a value to it. Return the new value of the memo...
int64_t lf_atomic_fetch_add64(int64_t *ptr, int64_t val)
Atomically fetch 64-bit integer from memory and add a value to it. Return the value that was previous...
int lf_atomic_val_compare_and_swap(int *ptr, int oldval, int newval)
Atomically perform a compare-and-swap operation on an integer in memory. If the value in memory is eq...