A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/srv__sync_8hpp_source.html below:

NCBI C++ ToolKit: src/app/netcache/srv_sync.hpp Source File

1 #ifndef NETCACHE__SRV_SYNC__HPP 2 #define NETCACHE__SRV_SYNC__HPP 44 #ifdef NCBI_COMPILER_GCC 51 #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) 57  return

__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

<

class

T1,

class

T2,

class

T3>

118 AtomicCAS

(T1

volatile

& var, T2 old_value, T3 new_value)

120  return AtomicCAS

(var, (T1)old_value, (T1)new_value);

123 template

<

class

T1,

class

T2>

130 template

<

class

T1,

class

T2>

220 #if NCBI_DEVELOPMENT_VER > 20141106

Wrapper 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