ROFL-pipeline  v0.6.0dev
atomic_operations.h
Go to the documentation of this file.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef __PLATFORM_ATOMIC_OPERATIONS_H__
6 #define __PLATFORM_ATOMIC_OPERATIONS_H__
7 
8 #include <inttypes.h>
9 #include "rofl.h"
10 #include "lock.h"
11 
12 #if defined(__COMPILING_ROFL_PIPELINE__) || !defined(ROFL_PIPELINE_PP_PRESENT) || !defined(ROFL_PIPELINE_INLINE_PP_PLATFORM_FUNCS)
13 
29 //C++ extern C
30 ROFL_BEGIN_DECLS
31 
42 void platform_atomic_inc64(uint64_t* counter, platform_mutex_t* mutex);
43 
54 void platform_atomic_inc32(uint32_t* counter, platform_mutex_t* mutex);
55 
66 void platform_atomic_dec32(uint32_t* counter, platform_mutex_t* mutex);
67 
78 void platform_atomic_add64(uint64_t* counter, uint64_t value, platform_mutex_t* mutex);
79 
90 void platform_atomic_add32(uint32_t* counter, uint32_t value, platform_mutex_t* mutex);
91 
92 //C++ extern C
93 ROFL_END_DECLS
94 
95 #endif //if
96 #endif //__PLATFORM_ATOMIC_OPERATIONS_H__
Defines the locking interface used by the library. The user of the library MUST provide an implementa...
void platform_atomic_dec32(uint32_t *counter, platform_mutex_t *mutex)
Performs an atomic decrement of the counter (32 bit type).
void platform_atomic_add32(uint32_t *counter, uint32_t value, platform_mutex_t *mutex)
Performs an atomic addition to the counter (32 bit type).
void platform_atomic_add64(uint64_t *counter, uint64_t value, platform_mutex_t *mutex)
Performs an atomic addition to the counter (64 bit type).
ROFL_BEGIN_DECLS void platform_atomic_inc64(uint64_t *counter, platform_mutex_t *mutex)
Performs an atomic increment to the counter (64 bit type).
void platform_atomic_inc32(uint32_t *counter, platform_mutex_t *mutex)
Performs an atomic increment to the counter (32 bit type).