picofuse-objc

NXAtomic.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include <picofuse/sys.h>
7 #include <stdint.h>
8 
21 @interface NXAtomic : NXObject {
22 @private
23  sys_atomic_t _atomic;
24 }
25 
29 + (id)atomicWithUnsignedInt32:(uint32_t)value;
30 
34 - (id)initWithUnsignedInt32:(uint32_t)value;
35 
39 - (uint32_t)unsignedInt32Value;
40 
44 - (void)setUnsignedInt32Value:(uint32_t)value;
45 
53 - (BOOL)compareAndSwap:(uint32_t)expected with:(uint32_t)desired;
54 
58 - (uint32_t)increment;
59 
63 - (uint32_t)decrement;
64 
68 - (void)setBits:(uint32_t)mask;
69 
73 - (void)clearBits:(uint32_t)mask;
74 
79 
80 @end
uint32_t increment()
Adds one, wrapping around to zero, and returns the new value.
uint32_t unsignedInt32Value()
Returns the value.
uint32_t decrement()
Takes away one, wrapping around to UINT32_MAX, and returns the new value.
bool BOOL
A Boolean value.
Definition: runtime.h:60
A string of UTF-8 text.
Definition: NXString.h:53
NXString * description()
Returns the value, in decimal.
The base class for objects in the Foundation framework.
Definition: NXObject.h:28
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
A 32-bit unsigned number, which threads can read and change without a lock.
Definition: NXAtomic.h:21