__sync_val_compare_and_swap(&var, old_value, new_value);
64 return__sync_bool_compare_and_swap(&var, old_value, new_value);
71 return__sync_add_and_fetch(&var, add_value);
78 return__sync_sub_and_fetch(&var, sub_value);
83 #define ACCESS_ONCE(x) x 116 template<
classT1,
classT2,
classT3>
118 AtomicCAS(T1
volatile& var, T2 old_value, T3 new_value)
120 return AtomicCAS(var, (T1)old_value, (T1)new_value);
123 template<
classT1,
classT2>
130 template<
classT1,
classT2>
220 #if NCBI_DEVELOPMENT_VER > 20141106Wrapper around Linux's futex.
CFutex & operator=(const CFutex &)
EWaitResult WaitValueChange(int old_value)
Wait for futex's value to change (with and without timeout).
volatile int m_Value
Value of the futex.
int GetValue(void)
Read value of the futex.
void SetValueNonAtomic(int new_value)
Set futex's value non-atomically, i.e.
EWaitResult
Type of result returned from WaitValueChange()
@ eWaitWokenUp
Thread was woken up by call to WakeUpWaiters() from another thread.
@ eValueChanged
Futex's value was changed in another thread before waiting was started.
@ eTimedOut
Method returned because total waiting time exceeded given timeout.
bool ChangeValue(int old_value, int new_value)
Atomically change value of the futex.
int WakeUpWaiters(int cnt_to_wake)
Wake up some threads waiting on this futex.
int AddValue(int cnt_to_add)
Atomically add some amount to futex's value.
static void ReportException(std::exception &ex)
Mutex created to have minimum possible size (its size is 4 bytes) and to sleep using kernel capabilit...
CMiniMutex(const CMiniMutex &)
Prohibit copying of the object.
void Unlock(void)
Unlock the mutex.
void Lock(void)
Lock the mutex.
CMiniMutex & operator=(const CMiniMutex &)
CFutex m_Futex
Futex which is used as base for mutex implementation.
bool TryLock(void)
Quickly try to lock mutex (without any retries).
Class incorporating convenient methods to work with struct timespec.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
T AtomicAdd(T volatile &var, T add_value)
T AtomicSub(T volatile &var, T sub_value)
CGuard< CMiniMutex > CMiniMutexGuard
T AtomicValCAS(T volatile &var, T old_value, T new_value)
bool AtomicCAS(T volatile &var, T old_value, T new_value)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4