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/lock__vector_8hpp_source.html below:

NCBI C++ ToolKit: include/util/lock_vector.hpp Source File

1 #ifndef UTIL_LOCK_VECTOR__HPP 2 #define UTIL_LOCK_VECTOR__HPP 97 template

<

class

TLockVect>

106  unsigned

timeout_ms);

120  unsigned

timeout_ms);

169 template

<

class

TLockVect>

172

: m_LockVector(&lvect),

174

m_Timeout(timeout_ms),

181 template

<

class

TLockVect>

185

: m_LockVector(&lvect),

187

m_Timeout(timeout_ms),

195 template

<

class

TLockVect>

201  catch

(exception& ex)

207 template

<

class

TLockVect>

217  for

(

unsigned i

= 0;

i

< m_Spins; ++

i

) {

218

m_LockSet = m_LockVector->TryLock(m_Id);

226  unsigned

sleep_ms = 10;

227  unsigned

time_spent = 0;

229

m_LockSet = m_LockVector->TryLock(m_Id);

235

time_spent += sleep_ms;

236  if

(time_spent > m_Timeout) {

237  string msg

=

"Lock vector timeout error on object id=" 246 template

<

class

TLockVect>

254 template

<

class

TLockVect>

260  bool

unlocked = m_LockVector->Unlock(m_Id);

274

m_LockVector =

lg

.m_LockVector; m_Id =

lg

.m_Id;

289  if

(m_IdVector.any()) {

291  "::~CLockVector() detected live locks on destruction."

);

299  bool

is_set = m_IdVector.set_bit_conditional(

id

,

true

,

false

);

307  bool

is_set = m_IdVector.set_bit_conditional(

id

,

false

,

true

);

309  _ASSERT

(m_IdVector[

id

] ==

false

);

318

m_IdVector.optimize(0, TBitVector::opt_free_0);

325  return

m_IdVector[id];

Lock guard for the CLockVector.

Class implements bit-vector based lock storage registering millions of int numbered objects.

#define ERR_POST_XX(error_name, err_subcode, message)

Error posting with error code having given name and with given error subcode.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)

Convert UInt to string.

TLockVector * m_LockVector

bool TryLock(unsigned id)

Try to acquire lock of specified id.

void TakeFrom(CLockVectorGuard &lg)

Transfer lock ownership from another lock.

CLockVectorGuard(TLockVector &lvect, unsigned id, unsigned timeout_ms)

Construct and lock.

void Release()

Forger lock.

TBitVector m_IdVector

vector of locked objs

unsigned GetTimeout() const

void FreeUnusedMem()

Reclaim unused memory.

void Lock(unsigned id)

Acquire lock.

CLockVectorGuard< TLockVect > & operator=(const CLockVectorGuard< TLockVect > &)

unsigned GetId() const

Get BLOB id.

CFastMutex m_IdVector_Lock

lock for m_LockVector

TLockVector & GetLockVector() const

CLockVectorGuard(TLockVector &lvect, unsigned timeout_ms)

Construct without locking.

bool IsLocked(unsigned id) const

Check if id is locked or not.

void Unlock()

Unlocks the lock.

CLockVectorGuard(const CLockVectorGuard< TLockVect > &)

bool Unlock(unsigned id)

Unlock object.

void SetId(unsigned id)

Assign Id (no locking)

void DoLock()

Lock acquisition.

CLockVector & operator=(const CLockVector< BV > &)

CLockVector(const CLockVector< BV > &)

@ BM_GAP

GAP compression is ON.

Definition of all error codes used in util (xutil.lib).

Compressed bitset (entry point to bm.h)

void SleepMilliSec(unsigned long ml_sec, EInterruptOnSignal onsignal=eRestartOnSignal)

Miscellaneous common-use basic types and functionality.

Multi-threading – mutexes; rw-locks; semaphore.

static SLJIT_INLINE sljit_ins lg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)


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