This built-in function returns true if objects of size bytes always generate lock free atomic instructions for the target architecture. size must resolve to a compile-time constant and the result also resolves to a compile-time constant. ptr is an optional pointer to the object that may be used to determine alignment. A value of 0 indicates typical alignment should be used. The compiler may also ignore this parameter. SourceEdit
This built-in function performs an atomic clear operation at p. After the operation, at p contains 0. ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_RELEASE SourceEdit
This proc implements the generic version of atomic_compare_exchange. The proc is virtually identical to atomic_compare_exchange_n, except the desired value is also a pointer. SourceEdit
This proc implements an atomic compare and exchange operation. This compares the contents at p with the contents at expected and if equal, writes desired at p. If they are not equal, the current contents at p is written into expected. Weak is true for weak compare_exchange, and false for the strong variation. Many targets only offer the strong variation and ignore the parameter. When in doubt, use the strong variation. True is returned if desired is written at p and the execution is considered to conform to the memory model specified by success_memmodel. There are no restrictions on what memory model can be used here. False is returned otherwise, and the execution is considered to conform to failure_memmodel. This memory model cannot be __ATOMIC_RELEASE nor __ATOMIC_ACQ_REL. It also cannot be a stronger model than that specified by success_memmodel. SourceEdit
proc atomicDec(memLoc: var int; x: int = 1): int {.inline, discardable,
...raises: [], tags: [], forbids: [].}
Atomically decrements the integer by some x. It returns the new value. SourceEdit
This proc implements an atomic exchange operation. It writes val at p, and returns the previous contents at p. ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_ACQUIRE, ATOMIC_RELEASE, ATOMIC_ACQ_REL SourceEdit
This built-in function returns true if objects of size bytes always generate lock free atomic instructions for the target architecture. If it is not known to be lock free a call is made to a runtime routine named __atomic_is_lock_free. ptr is an optional pointer to the object that may be used to determine alignment. A value of 0 indicates typical alignment should be used. The compiler may also ignore this parameter. SourceEdit
This proc implements an atomic load operation. It returns the contents at p. ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_ACQUIRE, ATOMIC_CONSUME. SourceEdit
This built-in function acts as a synchronization fence between a thread and signal handlers based in the same thread. All memory orders are valid. SourceEdit
This built-in function performs an atomic test-and-set operation on the byte at p. The byte is set to some implementation defined nonzero "set" value and the return value is true if and only if the previous contents were "set". All memory models are valid. SourceEdit