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

NCBI C++ ToolKit: Threads

typedef size_t  TNCBIAtomicValue   Define platform specific atomic-operations macros/values. More...
  typedef pthread_mutex_t  TSystemMutex   Define a platform independent system mutex. More...
  typedef TThreadSystemID  CThreadSystemID::TID   Define a simpler alias for TThreadSystemID. More...
  typedef CGuard< SSystemFastMutex >  TFastMutexGuard   typedefs for ease of use More...
  typedef TFastMutexGuard  CFastMutexGuard   ...and backward compatibility More...
  typedef CGuard< SSystemMutex >  TMutexGuard   typedefs for ease of use More...
  typedef TMutexGuard  CMutexGuard   ...and backward compatibility More...
  typedef CFastMutexGuard  CFastMutex::TReadLockGuard   Define Read Lock Guard. More...
  typedef CFastMutexGuard  CFastMutex::TWriteLockGuard   Define Write Lock Guard. More...
  typedef CMutexGuard  CMutex::TReadLockGuard   Define Read Lock Guard. More...
  typedef CMutexGuard  CMutex::TWriteLockGuard   Define Write Lock Guard. More...
  typedef CNoLock  CNoMutex   CNoMutex –. More...
  typedef CGuard< CSpinLockCSpinGuard   typedef CSpinGuard  CSpinLock::TReadLockGuard   Define Read Lock Guard. More...
  typedef CSpinGuard  CSpinLock::TWriteLockGuard   Define Write Lock Guard. More...
  typedef CGuard< CRWLock, SSimpleReadLock< CRWLock > >  TReadLockGuard   typedef TReadLockGuard  CReadLockGuard   typedef CGuard< CRWLock, SSimpleWriteLock< CRWLock > >  TWriteLockGuard   typedef TWriteLockGuard  CWriteLockGuard   typedef int  CRWLock::TFlags   binary OR of EFlags More...
  typedef CReadLockGuard  CRWLock::TReadLockGuard   Define Read Lock Guard. More...
  typedef CWriteLockGuard  CRWLock::TWriteLockGuard   Define Write Lock Guard. More...
  typedef CGuard< CFastRWLock, SSimpleReadLock< CFastRWLock >, SSimpleReadUnlock< CFastRWLock > >  CFastReadGuard   typedef CGuard< CFastRWLock, SSimpleWriteLock< CFastRWLock >, SSimpleWriteUnlock< CFastRWLock > >  CFastWriteGuard   typedef CFastReadGuard  CFastRWLock::TReadLockGuard   typedef CFastWriteGuard  CFastRWLock::TWriteLockGuard   typedef CIRef< IRWLockHolder_ListenerTRWLockHolder_ListenerRef   Types of smart references to IRWLockHolder_Listener. More...
  typedef CWeakIRef< IRWLockHolder_ListenerTRWLockHolder_ListenerWeakRef   typedef list< TRWLockHolder_ListenerWeakRefCRWLockHolder::TListenersList   typedef CRef< CRWLockHolderTRWLockHolderRef   Type that should be always used to store pointers to CRWLockHolder. More...
  typedef deque< TRWLockHolderRefCYieldingRWLock::THoldersList   typedef void(*  CTlsBase::FCleanupBase) (void *value, void *cleanup_data)   typedef void(*  CTls< TValue >::FCleanup) (TValue *value, void *cleanup_data)   Define cleanup function type, FCleanup. More...
  typedef pthread_key_t  CSimpleStaticTls< V >::key_type   typedef V  CSimpleStaticTls< V >::value_type   typedef void(*  CStaticTls_Callbacks< TValue >::FUserCleanup) (void *ptr)   typedef CSafeStatic< CTls< TValue >, CStaticTls_Callbacks< TValue > >  CStaticTls< TValue >::TParent   typedef CSafeStaticLifeSpan  CStaticTls< TValue >::TLifeSpan   typedef void(*  CStaticTls< TValue >::FUserCleanup) (void *ptr)   User cleanup function type. More...
  typedef void(*  CStaticTls< TValue >::FCleanup) (TValue *value, void *cleanup_data)   Define cleanup function type, FCleanup. More...
  typedef set< CTlsBase * >  CUsedTlsBases::TTlsSet   typedef int  CThread::TRunMode   Bitwise OR'd flags for thread creation passed to Run(). More...
  typedef unsigned int  CThread::TID   Get ID of current thread. More...
  typedef pthread_key_t  TTlsKey   Define internal TLS key type. More...
  typedef pthread_t  TThreadHandle   Define platform-dependent thread handle type. More...
  typedef pthread_t  TThreadSystemID   Define platform-dependent thread ID type. More...
  typedef void *  TWrapperRes   Define platform-dependent result wrapper. More...
  typedef void *  TWrapperArg   Define platform-dependent argument wrapper. More...
  typedef BV  CLockVector< BV >::TBitVector   typedef TLockVect  CLockVectorGuard< TLockVect >::TLockVector   enum   CMutexException::EErrCode {
  CMutexException::eLock , CMutexException::eUnlock , CMutexException::eTryLock , CMutexException::eOwner ,
  CMutexException::eUninitialized
}   Error types that a mutex can generate. More...
  enum   ncbi_namespace_mutex_mt::SSystemFastMutex::EMagic { ncbi_namespace_mutex_mt::SSystemFastMutex::eMutexUninitialized = 0 , ncbi_namespace_mutex_mt::SSystemFastMutex::eMutexInitialized = 0x2487adab }   Initialization flag values. More...
  enum   ncbi_namespace_mutex_mt::SSystemFastMutex::ELockSemantics { ncbi_namespace_mutex_mt::SSystemFastMutex::eNormal , ncbi_namespace_mutex_mt::SSystemFastMutex::ePseudo }   This is for condition variables. More...
  enum   CRWLock::EFlags { CRWLock::fFavorWriters = 0x1 }   Flags (passed at construction time) for fine-tuning lock behavior. More...
  enum   CRWLock::EInternalFlags { CRWLock::fTrackReaders = 0x40000000 }   enum   { CFastRWLock::kWriteLockValue = 0x100000 }   enum   ERWLockType { eReadLock = 0 , eWriteLock = 1 }   Type of locking provided by CYieldingRWLock. More...
  enum   CConditionVariableException::EErrCode {
  CConditionVariableException::eInvalidValue , CConditionVariableException::eMutexLockCount , CConditionVariableException::eMutexOwner , CConditionVariableException::eMutexDifferent ,
  CConditionVariableException::eUnsupported
}   Error types that a condition variable can generate. More...
  enum   CTlsBase::ENativeThreadCleanup { CTlsBase::eDoCleanup , CTlsBase::eSkipCleanup }   Flag indicating if cleanup function should be called when using native threads rather than CThread. More...
  enum   CTlsBase::ECleanupMode { CTlsBase::eCleanup_Toolkit , CTlsBase::eCleanup_Native }   Flag telling which code has called TLS cleanup. More...
  enum   CThread::ERunMode {
  CThread::fRunDefault = 0x00 , CThread::fRunDetached = 0x01 , CThread::fRunBound = 0x10 , CThread::fRunUnbound = 0x20 ,
  CThread::fRunNice = 0x40 , CThread::fRunAllowST = 0x100 , CThread::fRunCloneRequestContext = 0x200
}   Which mode should the thread run in. More...
  enum   CThreadException::EErrCode { CThreadException::eRunError , CThreadException::eControlError , CThreadException::eOther }   void *  NCBI_SwapPointers (void *volatile *location, void *new_value)   static TThreadSystemID  GetCurrentThreadSystemID (void)   Get the current thread ID. More...
  static CThreadSystemID  CThreadSystemID::GetCurrent (void)   Get the current thread ID. More...
  bool  CThreadSystemID::operator== (const CThreadSystemID &tid) const   Equality operator for thread ID. More...
  bool  CThreadSystemID::operator!= (const CThreadSystemID &tid) const   Non-equality operator for thread ID. More...
  void  CThreadSystemID::Set (const CThreadSystemID &tid) volatile   volatile versions of above methods More...
  bool  CThreadSystemID::Is (const CThreadSystemID &tid) const volatile   bool  CThreadSystemID::IsNot (const CThreadSystemID &tid) const volatile   virtual const char *  CMutexException::GetErrCodeString (void) const override   Translate from the error code value to its string representation. More...
    CMutexException::NCBI_EXCEPTION_DEFAULT (CMutexException, CCoreException)   void  ncbi_namespace_mutex_mt::SSystemFastMutex::Lock (ELockSemantics lock=eNormal)   Acquire mutex for the current thread with no nesting checks. More...
  void  ncbi_namespace_mutex_mt::SSystemFastMutex::Unlock (ELockSemantics lock=eNormal)   Release mutex with no owner or nesting checks. More...
  bool  ncbi_namespace_mutex_mt::SSystemFastMutex::TryLock (void)   Try to lock. More...
  void  ncbi_namespace_mutex_mt::SSystemFastMutex::CheckInitialized (void) const   Check initialized value of mutex. More...
  static NCBI_XNCBI_EXPORT void  ncbi_namespace_mutex_mt::SSystemFastMutex::ThrowUninitialized (void)   Throw uninitialized ("eUninitialized") exception. More...
  static NCBI_XNCBI_EXPORT void  ncbi_namespace_mutex_mt::SSystemFastMutex::ThrowLockFailed (void)   Throw lock failed("eLocked") exception. More...
  static NCBI_XNCBI_EXPORT void  ncbi_namespace_mutex_mt::SSystemFastMutex::ThrowUnlockFailed (void)   Throw unlock failed("eUnlocked") exception. More...
  static NCBI_XNCBI_EXPORT void  ncbi_namespace_mutex_mt::SSystemFastMutex::ThrowTryLockFailed (void)   Throw try lock failed("eTryLock") exception. More...
  bool  ncbi_namespace_mutex_mt::SSystemFastMutex::IsInitialized (void) const   Check if mutex is initialized. More...
  bool  ncbi_namespace_mutex_mt::SSystemFastMutex::IsUninitialized (void) const   Check if mutex is un-initialized. More...
  void  ncbi_namespace_mutex_mt::SSystemFastMutex::InitializeStatic (void)   Initialize static mutex. More...
  void  ncbi_namespace_mutex_mt::SSystemFastMutex::InitializeDynamic (void)   Initialize dynamic mutex. More...
  void  ncbi_namespace_mutex_mt::SSystemFastMutex::Destroy (void)   Destroy mutex. More...
  void  ncbi_namespace_mutex_mt::SSystemFastMutex::InitializeHandle (void)   Initialize mutex handle. More...
  void  ncbi_namespace_mutex_mt::SSystemFastMutex::DestroyHandle (void)   Destroy mutex handle. More...
  void  ncbi_namespace_mutex_mt::SSystemMutex::Lock (SSystemFastMutex::ELockSemantics lock=SSystemFastMutex::eNormal)   Acquire mutex for the current thread. More...
  void  ncbi_namespace_mutex_mt::SSystemMutex::Unlock (SSystemFastMutex::ELockSemantics lock=SSystemFastMutex::eNormal)   Release mutex. More...
  bool  ncbi_namespace_mutex_mt::SSystemMutex::TryLock (void)   Try to lock. More...
  static NCBI_XNCBI_EXPORT void  ncbi_namespace_mutex_mt::SSystemMutex::ThrowNotOwned (void)   Throw not owned("eOwner") exception. More...
  bool  ncbi_namespace_mutex_mt::SSystemMutex::IsInitialized (void) const   Check if mutex is initialized. More...
  bool  ncbi_namespace_mutex_mt::SSystemMutex::IsUninitialized (void) const   Check if mutex is un-initialized. More...
  void  ncbi_namespace_mutex_mt::SSystemMutex::InitializeStatic (void)   Initialize static mutex. More...
  void  ncbi_namespace_mutex_mt::SSystemMutex::InitializeDynamic (void)   Initialize dynamic mutex. More...
  void  ncbi_namespace_mutex_mt::SSystemMutex::Destroy (void)   Destroy mutex. More...
    CFastMutex::CFastMutex (void)   Constructor. More...
    CFastMutex::~CFastMutex (void)   Destructor. More...
  void  CFastMutex::Lock (void)   Acquire mutex for the current thread with no nesting checks. More...
  void  CFastMutex::Unlock (void)   Release mutex with no owner or nesting checks. More...
  bool  CFastMutex::TryLock (void)   Try locking the mutex. More...
    CFastMutex::operator SSystemFastMutex & (void)   Get SSystemFastMutex. More...
  TSystemMutexCFastMutex::GetHandle (void)   Get handle - Unix version. More...
    CFastMutex::CFastMutex (const CFastMutex &)   Private copy constructor to disallow initialization. More...
  CFastMutexCFastMutex::operator= (const CFastMutex &)   Private assignment operator to disallow assignment. More...
    CMutex::CMutex (void)   Constructor. More...
    CMutex::~CMutex (void)   Destructor. More...
    CMutex::operator SSystemMutex & (void)   Get SSystemMutex. More...
  void  CMutex::Lock (void)   Lock mutex. More...
  bool  CMutex::TryLock (void)   Try locking mutex. More...
  void  CMutex::Unlock (void)   Unlock mutex. More...
    CMutex::CMutex (const CMutex &)   Private copy constructor to disallow initialization. More...
  CMutexCMutex::operator= (const CMutex &)   Private assignment operator to disallow assignment. More...
    CSpinLock::CSpinLock (void)     CSpinLock::~CSpinLock (void)   void  CSpinLock::Lock (void)   Lock the mutex. More...
  bool  CSpinLock::TryLock (void)   Attempt to lock the mutex and return TRUE if it succeeded or FALSE if mutex is locked by other thread. More...
  void  CSpinLock::Unlock (void)   Unlock the mutex. More...
  bool  CSpinLock::IsLocked (void) const   Check if mutex is currently locked. More...
    CSpinLock::CSpinLock (const CSpinLock &)   Prohibit copying of the object. More...
  CSpinLockCSpinLock::operator= (const CSpinLock &)   void  SSimpleReadLock< Class >::operator() (Class &inst) const   void  SSimpleWriteLock< Class >::operator() (Class &inst) const     CRWLock::CRWLock (TFlags flags=0)   Constructor. More...
    CRWLock::~CRWLock (void)   Destructor. More...
  void  CRWLock::ReadLock (void)   Read lock. More...
  void  CRWLock::WriteLock (void)   Write lock. More...
  bool  CRWLock::TryReadLock (void)   Try read lock. More...
  bool  CRWLock::TryReadLock (const CTimeout &timeout)   Try read lock with timeout. More...
  bool  CRWLock::TryWriteLock (void)   Try write lock. More...
  bool  CRWLock::TryWriteLock (const CTimeout &timeout)   Try write lock with timeout. More...
  void  CRWLock::Unlock (void)   Release the RW-lock. More...
  bool  CRWLock::x_MayAcquireForReading (TThreadSystemID self_id)     CRWLock::CRWLock (const CRWLock &)   Private copy constructor to disallow initialization. More...
  CRWLockCRWLock::operator= (const CRWLock &)   Private assignment operator to disallow assignment. More...
  void  SSimpleReadUnlock< Class >::operator() (Class &inst) const   void  SSimpleWriteUnlock< Class >::operator() (Class &inst) const     CFastRWLock::CFastRWLock (void)     CFastRWLock::~CFastRWLock (void)   void  CFastRWLock::ReadLock (void)   Acquire read lock. More...
  void  CFastRWLock::ReadUnlock (void)   Release read lock. More...
  void  CFastRWLock::WriteLock (void)   Acquire write lock. More...
  void  CFastRWLock::WriteUnlock (void)   Release write lock. More...
    CFastRWLock::CFastRWLock (const CFastRWLock &)   CFastRWLockCFastRWLock::operator= (const CFastRWLock &)   virtual  IRWLockHolder_Listener::~IRWLockHolder_Listener (void)   virtual void  IRWLockHolder_Listener::OnLockAcquired (CRWLockHolder *holder)=0   Callback called when lock represented by CRWLockHolder is acquired. More...
  virtual void  IRWLockHolder_Listener::OnLockReleased (CRWLockHolder *holder)=0   Callback called when lock represented by CRWLockHolder is released. More...
  virtual  IRWLockHolder_Factory::~IRWLockHolder_Factory (void)   virtual CRWLockHolderIRWLockHolder_Factory::CreateHolder (CYieldingRWLock *lock, ERWLockType typ)=0   Obtain new CRWLockHolder object for given CYieldingRWLock and necessary lock type. More...
  virtual void  IRWLockHolder_Factory::DeleteHolder (CRWLockHolder *holder)=0   Free unnecessary (and unreferenced by anybody) CRWLockHolder object. More...
    CRWLockHolder::CRWLockHolder (IRWLockHolder_Factory *factory)   Create lock holder bound to given object factory. More...
  virtual  CRWLockHolder::~CRWLockHolder (void)   IRWLockHolder_FactoryCRWLockHolder::GetFactory (void) const   Get factory which this object was created from. More...
  CYieldingRWLockCRWLockHolder::GetRWLock (void) const   Get lock object that is locked by this holder. More...
  ERWLockType  CRWLockHolder::GetLockType (void) const   Get type of lock held. More...
  bool  CRWLockHolder::IsLockAcquired (void) const   Check if lock requested is already granted. More...
  void  CRWLockHolder::ReleaseLock (void)   Release the lock held or cancel request for the lock. More...
  void  CRWLockHolder::AddListener (IRWLockHolder_Listener *listener)   Add object keeping track of holder state changes. More...
  void  CRWLockHolder::RemoveListener (IRWLockHolder_Listener *listener)   Remove object keeping track of holder state changes. More...
  void  CRWLockHolder::Init (CYieldingRWLock *lock, ERWLockType typ)   Initialize holder for given CYieldingRWLock and necessary lock type. More...
  void  CRWLockHolder::Reset (void)   Reset holder to be able to use it later (after calling Init() ) More...
    CRWLockHolder::CRWLockHolder (const CRWLockHolder &)   CRWLockHolderCRWLockHolder::operator= (const CRWLockHolder &)   void  CRWLockHolder::x_OnLockAcquired (void)   Callback called at the moment when lock is granted. More...
  void  CRWLockHolder::x_OnLockReleased (void)   Callback called at the moment when lock is released. More...
  virtual void  CRWLockHolder::DeleteThis (void)   "Delete" this holder after last reference was removed. More...
    CYieldingRWLock::CYieldingRWLock (IRWLockHolder_Factory *factory=NULL)   Create read/write lock with custom holders factory. More...
    CYieldingRWLock::~CYieldingRWLock (void)   It is fatal error to destroy the object while some locks are pending. More...
  TRWLockHolderRef  CYieldingRWLock::AcquireReadLock (void)   Read lock. More...
  TRWLockHolderRef  CYieldingRWLock::AcquireWriteLock (void)   Write lock. More...
  TRWLockHolderRef  CYieldingRWLock::AcquireLock (ERWLockType lock_type)   General method to request read or write lock. More...
  bool  CYieldingRWLock::IsLocked (void)   Check if any type of lock on this object is held. More...
  void  CYieldingRWLock::x_ReleaseLock (CRWLockHolder *holder)   Main implementation releasing lock. More...
    CSemaphore::CSemaphore (unsigned int init_count, unsigned int max_count)   Constructor. More...
    CSemaphore::~CSemaphore (void)   Destructor. More...
  void  CSemaphore::Wait (void)   Wait on semaphore. More...
  bool  CSemaphore::TryWait (unsigned int timeout_sec=0, unsigned int timeout_nsec=0)   Timed wait. More...
  bool  CSemaphore::TryWait (const CTimeout &timeout)   Timed wait. Wait time specified by CTimeout. More...
  void  CSemaphore::Post (unsigned int count=1)   Increment the semaphore by "count". More...
    CSemaphore::CSemaphore (const CSemaphore &)   Private copy constructor to disallow initialization. More...
  CSemaphoreCSemaphore::operator= (const CSemaphore &)   Private assignment operator to disallow assignment. More...
    CConditionVariable::CConditionVariable (void)     CConditionVariable::~CConditionVariable (void)   static bool  CConditionVariable::IsSupported (void)   bool  CConditionVariable::WaitForSignal (CMutex &mutex, const CDeadline &deadline=CDeadline::eInfinite)   Release mutex and lock the calling thread until the condition variable is signalled. More...
  bool  CConditionVariable::WaitForSignal (CFastMutex &mutex, const CDeadline &deadline=CDeadline::eInfinite)   Release mutex and lock the calling thread until the condition variable is signalled. More...
  void  CConditionVariable::SignalSome (void)   Wake at least one of the threads that are currently waiting on this condition variable (if any threads are waiting on it). More...
  void  CConditionVariable::SignalAll (void)   Wake all threads that are currently waiting on the condition variable. More...
  bool  CConditionVariable::x_WaitForSignal (SSystemFastMutex &mutex, const CDeadline &timeout)   virtual const char *  CConditionVariableException::GetErrCodeString (void) const override   Translate from the error code value to its string representation. More...
    CConditionVariableException::NCBI_EXCEPTION_DEFAULT (CConditionVariableException, CCoreException)     CTlsBase::CTlsBase (bool auto_destroy)   Constructor. More...
    CTlsBase::~CTlsBase (void)   Destructor. More...
  void *  CTlsBase::x_GetValue (void) const   Helper method to get stored thread data. More...
  void  CTlsBase::x_SetValue (void *value, FCleanupBase cleanup, void *cleanup_data, ENativeThreadCleanup native)   Helper method to set thread data. More...
  void  CTlsBase::x_Reset (void)   Helper method to reset thread data. More...
  void  CTlsBase::x_Init (void)   Initialize thread data. More...
  void  CTlsBase::x_Destroy (void)   Destroy thread data. More...
  STlsDataCTlsBase::x_GetTlsData (void) const   Helper method to get the STlsData*. More...
  bool  CTlsBase::x_DeleteTlsData (ECleanupMode mode=eCleanup_Toolkit)   Deletes STlsData* structure and managed pointer Returns true if CTlsBase must be deregistered from current thread. More...
  static void  CTlsBase::CleanupAndDeleteTlsData (void *data, ECleanupMode mode=eCleanup_Toolkit)   static void  CTlsBase::CleanupTlsData (void *data, ECleanupMode mode=eCleanup_Toolkit)   static void  CTlsBase::x_CleanupThreadCallback (void *ptr)   template<class TValue > static void  CTlsBase::DefaultCleanup (TValue *value, void *)     CTls< TValue >::CTls (void)   TValue *  CTls< TValue >::GetValue (void) const   Get the pointer previously stored by SetValue(). More...
  void  CTls< TValue >::SetValue (TValue *value, FCleanup cleanup=0, void *cleanup_data=0, ENativeThreadCleanup native=eSkipCleanup)   Set value. More...
  void  CTls< TValue >::Reset (void)   Reset thread local storage. More...
  void  CTls< TValue >::Discard (void)   Discard thread local storage. More...
  static A  CSimpleStaticTls< V >::SCaster< A >::FromVoidP (void *p)   static const void *  CSimpleStaticTls< V >::SCaster< A >::ToVoidP (A v)   static ACSimpleStaticTls< V >::SCaster< A * >::FromVoidP (void *p)   static const void *  CSimpleStaticTls< V >::SCaster< A * >::ToVoidP (A *v)   key_type  CSimpleStaticTls< V >::x_GetKey (void) const   key_type  CSimpleStaticTls< V >::x_GetKeyLong (void) const     CSimpleStaticTls< V >::operator value_type () const   Getter - returns value stored in TLS. More...
  void  CSimpleStaticTls< V >::operator= (const value_type &v)   Setter - changes value stored in TLS. More...
    CStaticTls_Callbacks< TValue >::CStaticTls_Callbacks (FUserCleanup cleanup)   CTls< TValue > *  CStaticTls_Callbacks< TValue >::Create ()   void  CStaticTls_Callbacks< TValue >::Cleanup (CTls< TValue > &value)     CStaticTls< TValue >::CStaticTls (FUserCleanup user_cleanup=0, TLifeSpan life_span=TLifeSpan::GetDefault())   TValue *  CStaticTls< TValue >::GetValue (void)   void  CStaticTls< TValue >::SetValue (TValue *value, FCleanup cleanup=0, void *cleanup_data=0, CTlsBase::ENativeThreadCleanup native=CTlsBase::eSkipCleanup)     CUsedTlsBases::CUsedTlsBases (void)     CUsedTlsBases::~CUsedTlsBases (void)   void  CUsedTlsBases::ClearAll (CTlsBase::ECleanupMode mode=CTlsBase::eCleanup_Toolkit)   The function is called before thread termination to cleanup data stored in the TLS. More...
  void  CUsedTlsBases::Register (CTlsBase *tls)   void  CUsedTlsBases::Deregister (CTlsBase *tls)   static CUsedTlsBasesCUsedTlsBases::GetUsedTlsBases (void)   Get the list of used TLS-es for the current thread. More...
  static void  CUsedTlsBases::ClearAllCurrentThread (CTlsBase::ECleanupMode mode=CTlsBase::eCleanup_Toolkit)   Clear used TLS-es for the current thread. More...
  static void  CUsedTlsBases::Init (void)   Init TLS, call before creating thread. More...
    CUsedTlsBases::CUsedTlsBases (const CUsedTlsBases &)   void  CUsedTlsBases::operator= (const CUsedTlsBases &)     CThread::CThread (void)   Constructor. More...
  bool  CThread::Run (TRunMode flags=fRunDefault)   Run the thread. More...
  void  CThread::Detach (void)   Inform the thread that user does not need to wait for its termination. More...
  void  CThread::Join (void **exit_data=0)   Wait for the thread termination. More...
  static void  CThread::Exit (void *exit_data)   Cancel current thread. More...
  bool  CThread::Discard (void)   If the thread has not been Run() yet, then schedule the thread object for destruction, and return TRUE. More...
  bool  CThread::IsTerminated (void) const   Check if the thread has been terminated. More...
  static TID  CThread::GetSelf (void)   static bool  CThread::IsMain (void)   static CThreadCThread::GetCurrentThread (void)   Get current CThread object (or NULL, if main thread) More...
  static void  CThread::GetSystemID (TThreadSystemID *id)   Get system ID of the current thread - for internal use only. More...
  static unsigned int  CThread::GetThreadsCount ()   Get total amount of threads This amount does not contain main thread. More...
  static void  CThread::SetCurrentThreadName (const CTempString &)   Set name for the current thread. More...
  static void  CThread::InitializeMainThreadId (void)   Initialize main thread's TID. More...
  static bool  CThread::IsAppExiting (void)   Check if the application is exiting (entered the destructor). More...
  static void  CThread::SetWaitForAllThreadsTimeout (const CTimeout &timeout)   Set timeout for stopping all threads on application exit. More...
  virtual void *  CThread::Main (void)=0   Derived (user-created) class must provide a real thread function. More...
  virtual void  CThread::OnExit (void)   Override this to execute finalization code. More...
  virtual  CThread::~CThread (void)   To be called only internally! NOTE: destructor of the derived (user-provided) class should be declared "protected", too! More...
  TThreadHandle  CThread::GetThreadHandle ()   void  CThread::x_InitializeThreadId (void)   initalize new thread id, must be called from Wrapper(). More...
  static TWrapperRes  CThread::Wrapper (TWrapperArg arg)   Function to use (internally) as the thread's startup function. More...
  static bool  CThread::WaitForAllThreads (void)     CThread::CThread (const CThread &)   Prohibit copying and assigning. More...
  CThreadCThread::operator= (const CThread &)   virtual const char *  CThreadException::GetErrCodeString (void) const override   Translate from the error code value to its string representation. More...
    CThreadException::NCBI_EXCEPTION_DEFAULT (CThreadException, CException)     CLockVector< BV >::CLockVector ()     CLockVector< BV >::~CLockVector ()   bool  CLockVector< BV >::TryLock (unsigned id)   Try to acquire lock of specified id. More...
  bool  CLockVector< BV >::Unlock (unsigned id)   Unlock object. More...
  bool  CLockVector< BV >::IsLocked (unsigned id) const   Check if id is locked or not. More...
  void  CLockVector< BV >::FreeUnusedMem ()   Reclaim unused memory. More...
    CLockVector< BV >::CLockVector (const CLockVector< BV > &)   CLockVectorCLockVector< BV >::operator= (const CLockVector< BV > &)     CLockVectorGuard< TLockVect >::CLockVectorGuard (TLockVector &lvect, unsigned timeout_ms)   Construct without locking. More...
    CLockVectorGuard< TLockVect >::CLockVectorGuard (TLockVector &lvect, unsigned id, unsigned timeout_ms)   Construct and lock. More...
    CLockVectorGuard< TLockVect >::~CLockVectorGuard ()   void  CLockVectorGuard< TLockVect >::Lock (unsigned id)   Acquire lock. More...
  void  CLockVectorGuard< TLockVect >::Unlock ()   Unlocks the lock. More...
  void  CLockVectorGuard< TLockVect >::Release ()   Forger lock. More...
  unsigned  CLockVectorGuard< TLockVect >::GetId () const   Get BLOB id. More...
  void  CLockVectorGuard< TLockVect >::SetId (unsigned id)   Assign Id (no locking) More...
  void  CLockVectorGuard< TLockVect >::TakeFrom (CLockVectorGuard &lg)   Transfer lock ownership from another lock. More...
  void  CLockVectorGuard< TLockVect >::DoLock ()   Lock acquisition. More...
  TLockVectorCLockVectorGuard< TLockVect >::GetLockVector () const   unsigned  CLockVectorGuard< TLockVect >::GetTimeout () const     CLockVectorGuard< TLockVect >::CLockVectorGuard (const CLockVectorGuard< TLockVect > &)   CLockVectorGuard< TLockVect > &  CLockVectorGuard< TLockVect >::operator= (const CLockVectorGuard< TLockVect > &)   ◆ DECLARE_CLASS_STATIC_FAST_MUTEX #define DECLARE_CLASS_STATIC_FAST_MUTEX (   id )    static NCBI_NS_NCBI::SSystemFastMutex id

Declare static fast mutex.

Definition at line 500 of file ncbimtx.hpp.

◆ DECLARE_CLASS_STATIC_MUTEX #define DECLARE_CLASS_STATIC_MUTEX (   id )    static NCBI_NS_NCBI::SSystemMutex id ◆ DECLARE_TLS_VAR ◆ DEFINE_CLASS_STATIC_FAST_MUTEX

Define fast mutex and initialize it.

Definition at line 504 of file ncbimtx.hpp.

◆ DEFINE_CLASS_STATIC_MUTEX

Define mutex and initialize it.

Definition at line 520 of file ncbimtx.hpp.

◆ DEFINE_STATIC_FAST_MUTEX

Define static fast mutex and initialize it.

Definition at line 496 of file ncbimtx.hpp.

◆ DEFINE_STATIC_MUTEX

Define static mutex and initialize it.

Definition at line 512 of file ncbimtx.hpp.

◆ INTERNAL_MUTEX_DEBUG #define INTERNAL_MUTEX_DEBUG ◆ NCBI_ATOMIC_TYPE ◆ NCBI_COUNTER_ADD ◆ NCBI_COUNTER_ASM_OK ◆ NCBI_COUNTER_UNSIGNED ◆ NCBI_COUNTER_USE_STD_ATOMIC ◆ NCBI_HAVE_CONDITIONAL_VARIABLE #define NCBI_HAVE_CONDITIONAL_VARIABLE ◆ NCBI_NAMESPACE_MUTEX #define NCBI_NAMESPACE_MUTEX   ncbi_namespace_mutex_mt

Definition at line 147 of file ncbimtx.hpp.

◆ NCBI_SCHED_SPIN_INIT ◆ NCBI_SCHED_SPIN_YIELD #define NCBI_SCHED_SPIN_YIELD ( )    if ( !(++spin_counter & 3) ) ::SwitchToThread()

Definition at line 58 of file ncbi_atomic_defs.h.

◆ NCBI_SCHED_YIELD ◆ NCBI_STATIC_TLS_VIA_SAFE_STATIC_REF #define NCBI_STATIC_TLS_VIA_SAFE_STATIC_REF   1

Definition at line 292 of file ncbithr.hpp.

◆ NCBI_SWAP_POINTERS #define NCBI_SWAP_POINTERS (   loc,   nv  )    (InterlockedExchangePointer(loc, nv))

Definition at line 268 of file ncbi_atomic_defs.h.

◆ STATIC_FAST_MUTEX_INITIALIZER

Determine type of system mutex initialization.

Define static fast mutex initial value.

Definition at line 492 of file ncbimtx.hpp.

◆ STATIC_MUTEX_INITIALIZER

Define static mutex initializer.

Definition at line 508 of file ncbimtx.hpp.

◆ SYSTEM_MUTEX_INITIALIZER #define SYSTEM_MUTEX_INITIALIZER   PTHREAD_MUTEX_INITIALIZER

Definition at line 120 of file ncbimtx.hpp.

◆ THREAD_SYSTEM_ID_INITIALIZER #define THREAD_SYSTEM_ID_INITIALIZER   0

Use in defining initial value of system mutex.

Definition at line 164 of file ncbimtx.hpp.

◆ CFastMutexGuard

...and backward compatibility

Definition at line 391 of file ncbimtx.hpp.

◆ CFastReadGuard ◆ CFastWriteGuard ◆ CMutexGuard

...and backward compatibility

Definition at line 485 of file ncbimtx.hpp.

◆ CNoMutex

CNoMutex –.

Fake mutex that does not lock anything.

Allows to create template classes which use CMutex/CFastMutex/CNoMutex as an argument. In case of CNoMutex no real locking is performed.

See also
CNoLock

Definition at line 824 of file ncbimtx.hpp.

◆ CReadLockGuard ◆ CSpinGuard ◆ CWriteLockGuard ◆ FCleanup [1/2]

template<class TValue >

typedef void(* CTls< TValue >::FCleanup) (TValue *value, void *cleanup_data)

Define cleanup function type, FCleanup.

Definition at line 185 of file ncbithr.hpp.

◆ FCleanup [2/2]

Define cleanup function type, FCleanup.

Definition at line 327 of file ncbithr.hpp.

◆ FCleanupBase typedef void(* CTlsBase::FCleanupBase) (void *value, void *cleanup_data)

Definition at line 72 of file ncbithr.hpp.

◆ FUserCleanup [1/2] ◆ FUserCleanup [2/2]

template<class TValue >

typedef void(* CStaticTls< TValue >::FUserCleanup) (void *ptr)

User cleanup function type.

Definition at line 325 of file ncbithr.hpp.

◆ key_type ◆ TBitVector ◆ TFastMutexGuard ◆ TFlags ◆ THoldersList ◆ TID [1/2]

Define a simpler alias for TThreadSystemID.

Definition at line 180 of file ncbimtx.hpp.

◆ TID [2/2]

Get ID of current thread.

When not using native threads, but CThread only, the main thread is guaranteed to have zero id. With native threads the main thread may have a non-zero id and it's more reliable to use IsMain().

Definition at line 598 of file ncbithr.hpp.

◆ TLifeSpan ◆ TListenersList ◆ TLockVector ◆ TMutexGuard ◆ TNCBIAtomicValue

Define platform specific atomic-operations macros/values.

TNCBIAtomicValue "type" is defined based on facilities available for a compiler/platform. TNCBIAtomicValue is used in the CAtomicCounter class for defining the internal represntation of the counter.

Where possible NCBI_COUNTER_ADD is defined in terms of compiler/platform specific features, favoring inline assembly over standard library calls as function-call overhead can be appreciable, particularly on x86.

Definition at line 139 of file ncbi_atomic_defs.h.

◆ TParent ◆ TReadLockGuard [1/6] ◆ TReadLockGuard [2/6] ◆ TReadLockGuard [3/6] ◆ TReadLockGuard [4/6] ◆ TReadLockGuard [5/6] ◆ TReadLockGuard [6/6] ◆ TRunMode

Bitwise OR'd flags for thread creation passed to Run().

Definition at line 558 of file ncbithr.hpp.

◆ TRWLockHolder_ListenerRef ◆ TRWLockHolder_ListenerWeakRef ◆ TRWLockHolderRef ◆ TSystemMutex

Define a platform independent system mutex.

Definition at line 119 of file ncbimtx.hpp.

◆ TThreadHandle

Define platform-dependent thread handle type.

Definition at line 92 of file ncbithr_conf.hpp.

◆ TThreadSystemID ◆ TTlsKey ◆ TTlsSet ◆ TWrapperArg ◆ TWrapperRes ◆ TWriteLockGuard [1/6] ◆ TWriteLockGuard [2/6] ◆ TWriteLockGuard [3/6] ◆ TWriteLockGuard [4/6] ◆ TWriteLockGuard [5/6] ◆ TWriteLockGuard [6/6] ◆ value_type ◆ anonymous enum Enumerator kWriteLockValue 

Number in lock count showing that write lock is acquired.

Definition at line 1157 of file ncbimtx.hpp.

◆ ECleanupMode

Flag telling which code has called TLS cleanup.

Enumerator eCleanup_Toolkit 

Cleanup is performed by CThread.

eCleanup_Native 

Cleanup is performed by thread_local destructor.

Definition at line 84 of file ncbithr.hpp.

◆ EErrCode [1/3]

Error types that a mutex can generate.

Enumerator eLock 

Lock error.

eUnlock 

Unlock error.

eTryLock 

Attempted lock error.

eOwner 

Not owned error.

eUninitialized 

Uninitialized error.

Definition at line 233 of file ncbimtx.hpp.

◆ EErrCode [2/3]

Error types that a condition variable can generate.

Enumerator eInvalidValue 

Parameter of WaitForSignal function is invalid.

Mutex passed to WaitForSignal is not locked exactly once

eMutexLockCount 

Mutex passed to WaitForSignal is not owned by the current thread.

eMutexOwner 

Different mutexes were supplied for concurrent WaitForSignal operations on this condition variable.

eMutexDifferent 

Condition variable is not supported on this platform.

eUnsupported 

Definition at line 1528 of file ncbimtx.hpp.

◆ EErrCode [3/3] Enumerator eRunError 

Failed to run thread.

eControlError 

Failed to control thread's state.

eOther 

Other thread errors.

Definition at line 695 of file ncbithr.hpp.

◆ EFlags

Flags (passed at construction time) for fine-tuning lock behavior.

Enumerator fFavorWriters 

Forbid further readers from acquiring the lock if any writers are waiting for it, to keep would-be writers from starving.

Definition at line 956 of file ncbimtx.hpp.

◆ EInternalFlags Enumerator fTrackReaders 

Keep track of which threads have read locks.

Definition at line 1039 of file ncbimtx.hpp.

◆ ELockSemantics

This is for condition variables.

Enumerator eNormal  ePseudo 

Modify object data and call system.

Modify object data, but do not call system

Definition at line 287 of file ncbimtx.hpp.

◆ EMagic

Initialization flag values.

Enumerator eMutexUninitialized 

Uninitialized value.

eMutexInitialized 

Magic initialized value,.

Definition at line 280 of file ncbimtx.hpp.

◆ ENativeThreadCleanup

Flag indicating if cleanup function should be called when using native threads rather than CThread.

Native threads may perform cleanup later than CThread, so that some resources (like static variables) may be already destroyed. To prevent failures the default mode is eSkipCleanup.

Enumerator eDoCleanup  eSkipCleanup 

Definition at line 78 of file ncbithr.hpp.

◆ ERunMode

Which mode should the thread run in.

Enumerator fRunDefault 

Default mode.

fRunDetached 

Run the thread detached (non-joinable)

fRunBound 

Run thread in a 1:1 thread:LPW mode.

fRunUnbound 

Run thread in a N:1 thread:LPW mode.

fRunNice 

Run thread with low priority (MS-Win only)

fRunAllowST 

Allow threads to run in single thread builds.

fRunCloneRequestContext 

Clone parent's request context and pass it to the new thread.

The flag can be used when processing the same request in multiple child threads.

Definition at line 539 of file ncbithr.hpp.

◆ ERWLockType ◆ AcquireLock() ◆ AcquireReadLock()

Read lock.

Method returns immediately no matter if lock is granted or not. If lock is not granted then request for lock is remembered and will be granted later unless CRWLockHolder::ReleaseLock() is called (or object is deleted).

◆ AcquireWriteLock()

Write lock.

Method returns immediately no matter if lock is granted or not. If lock is not granted then request for lock is remembered and will be granted later unless CRWLockHolder::ReleaseLock() is called (or object is deleted).

◆ AddListener()

Add object keeping track of holder state changes.

◆ CConditionVariable() CConditionVariable::CConditionVariable ( void  ) ◆ CFastMutex() [1/2]

Private copy constructor to disallow initialization.

◆ CFastMutex() [2/2] CFastMutex::CFastMutex ( void  )

Constructor.

Creates mutex handle.

◆ CFastRWLock() [1/2] ◆ CFastRWLock() [2/2] CFastRWLock::CFastRWLock ( void  ) ◆ CheckInitialized() void ncbi_namespace_mutex_mt::SSystemFastMutex::CheckInitialized ( void  ) const

Check initialized value of mutex.

◆ Cleanup() ◆ CleanupAndDeleteTlsData() ◆ CleanupTlsData() ◆ ClearAll()

The function is called before thread termination to cleanup data stored in the TLS.

Definition at line 82 of file ncbithr.cpp.

References set< Key, Compare >::clear(), CSafeStatic< T, Callbacks >::Get(), CTlsBase::m_AutoDestroy, CUsedTlsBases::m_UsedTls, NON_CONST_ITERATE, NULL, CObject::Referenced(), CObject::RemoveReference(), CUsedTlsBases::sm_UsedTlsBases, and CTlsBase::x_DeleteTlsData().

Referenced by s_CleanupMainUsedTlsBases().

◆ ClearAllCurrentThread() ◆ CLockVector() [1/2] ◆ CLockVector() [2/2] ◆ CLockVectorGuard() [1/3]

template<class TLockVect >

◆ CLockVectorGuard() [2/3]

template<class TLockVect >

Construct and lock.

Parameters
lvect Lock vector storing all locks id Object Id we are locking timeout_ms Timeout in milliseconds for how long lock makes attempts to acquire the id. If cannot lock it throws an exception.

Definition at line 182 of file lock_vector.hpp.

References _ASSERT, and CLockVectorGuard< TLockVect >::DoLock().

◆ CLockVectorGuard() [3/3]

template<class TLockVect >

◆ CMutex() [1/2]

Private copy constructor to disallow initialization.

◆ CMutex() [2/2] ◆ Create() ◆ CreateHolder() ◆ CRWLock() [1/2]

Private copy constructor to disallow initialization.

◆ CRWLock() [2/2] CRWLock::CRWLock ( TFlags  flags = 0 ) ◆ CRWLockHolder() [1/2] ◆ CRWLockHolder() [2/2]

Create lock holder bound to given object factory.

◆ CSemaphore() [1/2]

Private copy constructor to disallow initialization.

◆ CSemaphore() [2/2] CSemaphore::CSemaphore ( unsigned int  init_count, unsigned int  max_count  )

Constructor.

Parameters
int_count The initial value of the semaphore. max_count Maximum value that semaphore value can be incremented to. NOTE: On Windows max_count can not be greater than LONG_MAX.

Definition at line 1696 of file ncbimtx.cpp.

References SSemaphore::cond, SSemaphore::count, ERR_POST, Error(), CSemaphore::m_Sem, SSemaphore::max_count, min(), SSemaphore::mutex, NULL, SSemaphore::wait_count, xncbi_Validate, and xncbi_ValidatePthread.

◆ CSpinLock() [1/2]

Prohibit copying of the object.

◆ CSpinLock() [2/2] CSpinLock::CSpinLock ( void  ) ◆ CStaticTls() ◆ CStaticTls_Callbacks() ◆ CThread() [1/2]

Prohibit copying and assigning.

◆ CThread() [2/2] CThread::CThread ( void  ) ◆ CTls() ◆ CTlsBase() CTlsBase::CTlsBase ( bool  auto_destroy ) inlineprotected ◆ CUsedTlsBases() [1/2] ◆ CUsedTlsBases() [2/2] CUsedTlsBases::CUsedTlsBases ( void  ) ◆ CYieldingRWLock() ◆ DefaultCleanup()

template<class TValue >

static void CTlsBase::DefaultCleanup ( TValue *  value, void *    ) inlinestatic ◆ DeleteHolder() virtual void IRWLockHolder_Factory::DeleteHolder ( CRWLockHolderholder ) pure virtual ◆ DeleteThis() void CRWLockHolder::DeleteThis ( void  ) privatevirtual ◆ Deregister() void CUsedTlsBases::Deregister ( CTlsBasetls ) ◆ Destroy() [1/2] void SSystemFastMutex::Destroy ( void  ) ◆ Destroy() [2/2] void SSystemMutex::Destroy ( void  ) ◆ DestroyHandle() void SSystemFastMutex::DestroyHandle ( void  ) ◆ Detach() void CThread::Detach ( void  )

Inform the thread that user does not need to wait for its termination.

The thread object will be destroyed by Exit(). If the thread has already been terminated by Exit, Detach() will also schedule the thread object for destruction. NOTE: it is no more safe to use this thread object after Detach(), unless there are still CRef<> based references to it!

Definition at line 833 of file ncbithr.cpp.

References CThread::m_Handle, CThread::m_IsDetached, CThread::m_IsRun, CThread::m_IsTerminated, CThread::m_SelfRef, NCBI_THREAD_VALIDATE, NULL, and CRef< C, Locker >::Reset().

Referenced by CPoolOfThreads< CRef< CStdRequest > >::Register().

◆ Discard() [1/2]

template<class TValue >

void CTls< TValue >::Discard ( void  ) inline

Discard thread local storage.

Schedule the TLS to be destroyed as soon as there are no CRef to it left.

Definition at line 223 of file ncbithr.hpp.

◆ Discard() [2/2] bool CThread::Discard ( void  ) ◆ DoLock()

template<class TLockVect >

◆ Exit() void CThread::Exit ( void *  exit_data ) static ◆ FreeUnusedMem() ◆ FromVoidP() [1/2]

template<class V >

template<class A >

◆ FromVoidP() [2/2]

template<class V >

template<class A >

◆ GetCurrent() ◆ GetCurrentThread() CThread * CThread::GetCurrentThread ( void  ) static ◆ GetCurrentThreadSystemID()

Get the current thread ID.

Definition at line 152 of file ncbimtx.hpp.

Referenced by CFileIO::CreateTemporary(), CThreadSystemID::GetCurrent(), CThread::GetSystemID(), ncbi_namespace_mutex_mt::SSystemMutex::Lock(), CJaegerTracer::OnRequestStart(), COpentelemetryTracer::OnRequestStart(), CRWLock::ReadLock(), s_GetThreadId(), ncbi_namespace_mutex_mt::SSystemMutex::TryLock(), CRWLock::TryReadLock(), CRWLock::TryWriteLock(), ncbi_namespace_mutex_mt::SSystemMutex::Unlock(), CRWLock::Unlock(), CConditionVariable::WaitForSignal(), CRWLock::WriteLock(), CSyncQueue< Type, Container, Traits >::x_GuardedLock(), CSyncQueue< Type, Container, Traits >::x_IsGuarded(), and CRWLock::x_MayAcquireForReading().

◆ GetErrCodeString() [1/3] const char * CMutexException::GetErrCodeString ( void  ) const overridevirtual ◆ GetErrCodeString() [2/3] const char * CConditionVariableException::GetErrCodeString ( void  ) const overridevirtual ◆ GetErrCodeString() [3/3] const char * CThreadException::GetErrCodeString ( void  ) const overridevirtual ◆ GetFactory()

Get factory which this object was created from.

◆ GetHandle() ◆ GetId()

template<class TLockVect >

◆ GetLockType() ◆ GetLockVector() ◆ GetRWLock()

Get lock object that is locked by this holder.

◆ GetSelf()

Definition at line 515 of file ncbithr.cpp.

References CThread::InitializeMainThreadId(), kMainThreadId, sm_MainThreadIdInitialized, and sx_GetNextThreadId().

Referenced by CBlastDbDataLoader::GetLoaderNameFromArgs(), CThreadLocalTransactional::GetTransaction(), CIgBlastnApp::CIgWorker::Main(), CIgBlastnApp::CIgFormatter::Main(), CRandom::Randomize(), CThreadLocalTransactional::RemoveTransaction(), s_CountBlastDbDataLoaders(), s_GetThreadId(), sAssertMainThread(), CBlastNode::SetDataLoaderPrefix(), CThreadLocalTransactional::SetTransaction(), CSeqDBImpl::x_GetCacheID(), CSeqDBVol::x_GetFilteredHeader(), CAsnCache_DataLoader::x_GetIndex(), CSeqDBVol::x_GetTaxonomy(), and SDiagMessage::x_OldWrite().

◆ GetSystemID() ◆ GetThreadHandle() ◆ GetThreadsCount() unsigned int CThread::GetThreadsCount ( ) inlinestatic ◆ GetTimeout() ◆ GetUsedTlsBases() ◆ GetValue() [1/2] ◆ GetValue() [2/2]

template<class TValue >

TValue* CTls< TValue >::GetValue ( void  ) const inline ◆ Init() [1/2] ◆ Init() [2/2] void CUsedTlsBases::Init ( void  ) static ◆ InitializeDynamic() [1/2] void SSystemFastMutex::InitializeDynamic ( void  )

Initialize dynamic mutex.

Initialize mutex if it located in heap or stack. This must be called only once. Do not count on zeroed memory values for initializing mutex values.

Definition at line 207 of file ncbimtx.cpp.

◆ InitializeDynamic() [2/2] void ncbi_namespace_mutex_mt::SSystemMutex::InitializeDynamic ( void  )

Initialize dynamic mutex.

Initialize mutex if it located in heap or stack. This must be called only once. Do not count on zeroed memory values for initializing mutex values.

◆ InitializeHandle() void SSystemFastMutex::InitializeHandle ( void  ) ◆ InitializeMainThreadId() void CThread::InitializeMainThreadId ( void  ) static ◆ InitializeStatic() [1/2] void SSystemFastMutex::InitializeStatic ( void  ) ◆ InitializeStatic() [2/2] void ncbi_namespace_mutex_mt::SSystemMutex::InitializeStatic ( void  )

Initialize static mutex.

Must be called only once.

◆ Is() ◆ IsAppExiting() ◆ IsInitialized() [1/2] bool ncbi_namespace_mutex_mt::SSystemFastMutex::IsInitialized ( void  ) const

Check if mutex is initialized.

Returns
TRUE if initialized; FALSE, otherwise.
◆ IsInitialized() [2/2] bool ncbi_namespace_mutex_mt::SSystemMutex::IsInitialized ( void  ) const

Check if mutex is initialized.

Returns
TRUE if initialized; FALSE, otherwise.
◆ IsLockAcquired() bool CRWLockHolder::IsLockAcquired ( void  ) const

Check if lock requested is already granted.

◆ IsLocked() [1/3] ◆ IsLocked() [2/3] bool CYieldingRWLock::IsLocked ( void  )

Check if any type of lock on this object is held.

◆ IsLocked() [3/3] bool CSpinLock::IsLocked ( void  ) const

Check if mutex is currently locked.

◆ IsMain() bool CThread::IsMain ( void  ) static ◆ IsNot() ◆ IsSupported() bool CConditionVariable::IsSupported ( void  ) static

Definition at line 2358 of file ncbimtx.cpp.

◆ IsTerminated() bool CThread::IsTerminated ( void  ) const inline ◆ IsUninitialized() [1/2] bool ncbi_namespace_mutex_mt::SSystemFastMutex::IsUninitialized ( void  ) const

Check if mutex is un-initialized.

Returns
TRUE if un-initialized; FALSE, otherwise.
◆ IsUninitialized() [2/2] bool ncbi_namespace_mutex_mt::SSystemMutex::IsUninitialized ( void  ) const

Check if mutex is un-initialized.

Returns
TRUE if un-initialized; FALSE, otherwise.
◆ Join() void CThread::Join ( void **  exit_data = 0 )

Wait for the thread termination.

The thread object will be scheduled for destruction right here, inside Join(). Only one call to Join() is allowed.

Definition at line 863 of file ncbithr.cpp.

References CThread::m_ExitData, CThread::m_Handle, CThread::m_IsDetached, CThread::m_IsJoined, CThread::m_IsRun, CThread::m_SelfRef, NCBI_THREAD_VALIDATE, NULL, and CRef< C, Locker >::Reset().

Referenced by CBlastAsyncFormatThread::Join(), CNCMMCentral::PrepareToStop(), CMergeyApp::Run(), CMagicBlastApp::Run(), SGridWorkerNodeImpl::Run(), CSchedulerEngine::ShutDown(), CAsyncTaskProcessor< TTask >::CExecutor::SThread::Stop(), CIStreamIteratorThread_Base< TRoot, TObject >::Stop(), CAsyncDiagThread::Stop(), CBDB_Env::StopBackgroundWriterThread(), CQueueDataBase::StopExecutionWatcherThread(), CQueueDataBase::StopNotifThread(), CBDB_Cache::StopPurgeThread(), CQueueDataBase::StopPurgeThread(), CQueueDataBase::StopServiceThread(), CNetStorageServer::StopServiceThread(), CMMAligner::x_DoSubmatrix(), CNSTDatabase::~CNSTDatabase(), CWGSClient::~CWGSClient(), CWGSDataLoader_Impl::~CWGSDataLoader_Impl(), and SNetScheduleAPIImpl::~SNetScheduleAPIImpl().

◆ Lock() [1/6] ◆ Lock() [2/6] ◆ Lock() [3/6]

template<class TLockVect >

◆ Lock() [4/6] void CFastMutex::Lock ( void  )

Acquire mutex for the current thread with no nesting checks.

Referenced by CRtProfiler::AddMarkerMT(), CRtProfiler::AddUserKVMT(), CRtProfiler::AsStringMT(), BlastLockHandler(), CBlastAsyncFormatThread::Finalize(), CServer_ConnectionPool::GetListenerPorts(), CServer_ConnectionPool::GetPollAndTimerVec(), CBDB_Cache::Lock(), CDBConnectionFactory::CServiceInfo::Lock(), CBlastAsyncFormatThread::Main(), CBlastKmerThread::Main(), CBlastAsyncFormatThread::QueueResults(), CFastRWLock::ReadLock(), CServer_ConnectionPool::RemoveListener(), CServer_ConnectionPool::SetAllActive(), CRtProfiler::StartMT(), CRtProfiler::StopMT(), CThreadGroup::SyncPoint(), CFastRWLock::WriteLock(), CNCMMCentral::x_DoBackgroundWork(), and CNSTDBConnectionThread::x_RestoreConnection().

◆ Lock() [5/6] void CMutex::Lock ( void  ) ◆ Lock() [6/6] void CSpinLock::Lock ( void  )

Lock the mutex.

Definition at line 2326 of file ncbimtx.cpp.

References CSpinLock::m_Value, NCBI_SCHED_YIELD, NULL, and SwapPointers().

Referenced by CObjPool< CRWLockHolder, THolderPoolFactory >::Clear(), CObjPool< CRWLockHolder, THolderPoolFactory >::Get(), CObjPool< CRWLockHolder, THolderPoolFactory >::Return(), CRWLockHolder::x_OnLockAcquired(), and CRWLockHolder::x_OnLockReleased().

◆ Main() virtual void* CThread::Main ( void  ) protectedpure virtual

Derived (user-created) class must provide a real thread function.

Implemented in CBlastNode, CIStreamStdIteratorThread< TRoot, TObject >, CIStreamObjectIteratorThread< TRoot, TObject >, CThreadPool_ServiceThread, CScheduler_ExecThread_Impl, CSeqDBDemo_Thread, CTotalRangeThread, CMTTestThread, CSchedulerEngineThread, CSQLITE_AsyncWritesThread, CInGroupThread, CTestThread, CAsyncDiagThread, CWorkerNodeIdleThread, CGridControlThread, CNetStorageServiceThread, CNSTDBConnectionThread, CJobQueueExecutionWatcherThread, CJobQueueCleanerThread, CServiceThread, CGetJobNotificationThread, CMagicBlastThread, CIgBlastnApp::CIgFormatter, CIgBlastnApp::CIgWorker, CAsyncTaskProcessor< TTask >::CExecutor::SThread, CTblastnNode, CRPSTBlastnNode, CRPSBlastNode, CBlastxNode, CBlastpNode, CBlastnNode, CSearch< LEGACY, NHITS >, CVDBThread, CTestThread, CSeqDBTest3Thread, CSeqDBTest2Thread, CSeqDBTestThread, CDLTest2Thread, CDLTestThread, CHspStreamWriteThread, CBlastKmerThread, CRPSThread, CPrelimSearchThread, CMergeOutputThread, CMergeTreeThread, CThreadInPool< TRequest >, CThreadInPool< CRef< CStdRequest > >, CThreadPool_Thread, CThreadNonStop, CIStreamIteratorThread_Base< TRoot, TObject >, CPrefetchThreadOld, CAssemblyCache::CWorkerThread, CConnTestThread, CThreadInPool_ForServer, CBlastAsyncFormatThread, CLocalAdapterThread, CJobCommitterThread, CGridCleanupThread, SNetScheduleNotificationThread, CMainLoopThread, CAsn2AsnThread, CNWAlignerThread_Align, CThreadDoSM, CThreadRunOnTop, and CSQLITE3_Cache::CWriterThread.

Referenced by CThread::Wrapper().

◆ NCBI_EXCEPTION_DEFAULT() [1/3] ◆ NCBI_EXCEPTION_DEFAULT() [2/3] ◆ NCBI_EXCEPTION_DEFAULT() [3/3] ◆ NCBI_SwapPointers() void* NCBI_SwapPointers ( void *volatile *  location, void *  new_value  ) inline ◆ OnExit() void CThread::OnExit ( void  ) protectedvirtual

Override this to execute finalization code.

Unlike destructor, this code will be executed before thread termination and as a part of the thread.

Reimplemented in CSeqDBDemo_Thread, CTestThread, CWorkerNodeIdleThread, CGridControlThread, CIgBlastnApp::CIgFormatter, CIgBlastnApp::CIgWorker, CSearch< LEGACY, NHITS >, CHspStreamWriteThread, CThreadInPool< TRequest >, CThreadInPool< CRef< CStdRequest > >, CThreadPool_Thread, CNWAlignerThread_Align, CThreadDoSM, and CThreadRunOnTop.

Definition at line 940 of file ncbithr.cpp.

Referenced by CGridControlThread::OnExit(), and CThread::Wrapper().

◆ OnLockAcquired() virtual void IRWLockHolder_Listener::OnLockAcquired ( CRWLockHolderholder ) pure virtual

Callback called when lock represented by CRWLockHolder is acquired.

◆ OnLockReleased() virtual void IRWLockHolder_Listener::OnLockReleased ( CRWLockHolderholder ) pure virtual

Callback called when lock represented by CRWLockHolder is released.

◆ operator SSystemFastMutex &() CFastMutex::operator SSystemFastMutex & ( void  )

Get SSystemFastMutex.

◆ operator SSystemMutex &() CMutex::operator SSystemMutex & ( void  )

Get SSystemMutex.

◆ operator value_type() ◆ operator!=() ◆ operator()() [1/4] ◆ operator()() [2/4] ◆ operator()() [3/4] ◆ operator()() [4/4] ◆ operator=() [1/12]

Private assignment operator to disallow assignment.

◆ operator=() [2/12] ◆ operator=() [3/12] ◆ operator=() [4/12]

template<class TLockVect >

◆ operator=() [5/12]

Private assignment operator to disallow assignment.

◆ operator=() [6/12]

Private assignment operator to disallow assignment.

◆ operator=() [7/12] ◆ operator=() [8/12]

Private assignment operator to disallow assignment.

◆ operator=() [9/12] ◆ operator=() [10/12] ◆ operator=() [11/12] ◆ operator=() [12/12] ◆ operator==() ◆ Post() void CSemaphore::Post ( unsigned int  count = 1 )

Increment the semaphore by "count".

Do nothing and throw an exception if counter would exceed "max_count".

Definition at line 1971 of file ncbimtx.cpp.

References SSemaphore::cond, SSemaphore::count, count, kMax_UInt, CSemaphore::m_Sem, SSemaphore::max_count, SSemaphore::mutex, NULL, SSemaphore::wait_count, xncbi_Validate, xncbi_ValidateAndErrnoReport, and xncbi_ValidatePthread.

Referenced by CThreadPool_Impl::Abort(), CPrefetchTokenOld_Impl::AddResolvedId(), CSchedulerEngine::CancelJob(), CBlastAsyncFormatThread::Finalize(), CTestThread::GlobalSyncPoint(), CThreadGroup::Go(), SServerNotifications::InterruptWait(), SGridWorkerNodeImpl::LeaveExclusiveMode(), CGridCleanupThread::Main(), CBlastAsyncFormatThread::Main(), CIgBlastnApp::CIgWorker::Main(), CAsyncDiagThread::Main(), impl::CDriverContext::MakePooledConnection(), CPSGL_QueueGuard::MarkAsFinished(), CIStreamIteratorThread_Base< TRoot, TObject >::Next(), CPrefetchTokenOld_Impl::NextBioseqHandle(), CScheduler_ExecThread_Impl::OnNextExecutionTimeChange(), CBlastAsyncFormatThread::QueueResults(), SServerNotifications::RegisterServer(), CPrefetchTokenOld_Impl::RemoveTokenReference(), CThreadNonStop::RequestDoJob(), CWorkerNodeIdleThread::RequestShutdown(), CThreadNonStop::RequestStop(), CGetJobNotificationThread::RequestStop(), CJobQueueCleanerThread::RequestStop(), CJobQueueExecutionWatcherThread::RequestStop(), CWorkerNodeIdleThread::Schedule(), CIStreamIteratorThread_Base< TRoot, TObject >::SetObject(), CSchedulerEngine::ShutDown(), CSchedulerEngine::StartJob(), CIStreamIteratorThread_Base< TRoot, TObject >::Stop(), CAsyncDiagThread::Stop(), CScheduler_ExecThread_Impl::Stop(), CBDB_Cache::StopPurge(), CWorkerNodeIdleThread::Suspend(), CThreadGroup::SyncPoint(), CThreadPool_Impl::TaskFinished(), CThreadGroup::ThreadComplete(), CThreadPool_Impl::ThreadStateChanged(), SGridWorkerNodeImpl::WaitForExclusiveJobToFinish(), CJobCommitterThread::WakeUp(), CGetJobNotificationThread::WakeUp(), CNSTDBConnectionThread::Wakeup(), CThreadPool_ThreadImpl::WakeUp(), CThreadPool_ServiceThread::WakeUp(), impl::CDriverContext::x_Recycle(), CReader::x_ReleaseClosedConnection(), and CReader::x_ReleaseConnection().

◆ ReadLock() [1/2] void CRWLock::ReadLock ( void  )

Read lock.

Acquire the R-lock. If W-lock is already acquired by another thread, then wait until it is released.

Definition at line 863 of file ncbimtx.cpp.

References _VERIFY, CRWLock::fTrackReaders, GetCurrentThreadSystemID(), HANDLE, interlocked_dec_max(), interlocked_inc_min(), CRWLock::m_Count, CRWLock::m_Flags, CRWLock::m_Owner, CRWLock::m_Readers, CRWLock::m_RW, CRWLock::m_WaitingWriters, TRUE, CRWLock::x_MayAcquireForReading(), xncbi_Validate, xncbi_ValidateAndErrnoReport, and xncbi_ValidatePthread.

Referenced by IRegistry::ReadLock(), s_LOCK_Handler(), and CRWLock::TryReadLock().

◆ ReadLock() [2/2] void CFastRWLock::ReadLock ( void  ) ◆ ReadUnlock() void CFastRWLock::ReadUnlock ( void  ) ◆ Register() void CUsedTlsBases::Register ( CTlsBasetls ) ◆ Release()

template<class TLockVect >

◆ ReleaseLock() void CRWLockHolder::ReleaseLock ( void  ) ◆ RemoveListener()

Remove object keeping track of holder state changes.

◆ Reset() [1/2] void CRWLockHolder::Reset ( void  ) ◆ Reset() [2/2]

template<class TValue >

void CTls< TValue >::Reset ( void  ) inline ◆ Run()

Run the thread.

Create a new thread, initialize it, and call user-provided Main() method.

Definition at line 724 of file ncbithr.cpp.

References CRequestContext::Clone(), FALSE, flags, CThread::fRunAllowST, CThread::fRunCloneRequestContext, CThread::fRunDetached, CThread::fRunNice, CThread::fRunUnbound, CDiagContext::GetRequestContext(), HANDLE, CUsedTlsBases::Init(), CThread::m_Handle, CThread::m_IsDetached, CThread::m_IsRun, CThread::m_ParentRequestContext, CThread::m_SelfRef, NCBI_THREAD_VALIDATE, NULL, CRef< C, Locker >::Reset(), CThread::sm_ThreadsCount, ThreadWrapperCallerImpl(), and CThread::Wrapper().

Referenced by BOOST_AUTO_TEST_CASE(), CNSTDatabase::CNSTDatabase(), CScheduler_ExecThread_Impl::CScheduler_ExecThread_Impl(), CSchedulerEngine::CSchedulerEngine(), CWGSDataLoader_Impl::GetResolver(), CWGSClient::GetWGSResolver(), CAsyncDiagHandler::InstallToDiag(), CDataSource::Prefetch(), CMergeyApp::Run(), CMagicBlastApp::Run(), SGridWorkerNodeImpl::Run(), CBlastKmerApplication::Run(), CBDB_Env::RunBackgroundWriter(), CQueueDataBase::RunExecutionWatcherThread(), CNCMMCentral::RunLateInit(), CQueueDataBase::RunNotifThread(), CQueueDataBase::RunPurgeThread(), CQueueDataBase::RunServiceThread(), CNetStorageServer::RunServiceThread(), CThreadPool_Impl::SetInterfaceStarted(), CAsyncTaskProcessor< CRemoteAppReaperTask >::CExecutor::Start(), SNetScheduleAPIImpl::StartNotificationThread(), CBDB_Cache::StartPurgeThread(), CMMAligner::x_DoSubmatrix(), and CNWAligner::x_Run().

◆ Set() ◆ SetCurrentThreadName()

Set name for the current thread.

This works on most POSIX platforms, no-op on other platforms

Definition at line 958 of file ncbithr.cpp.

References CTempString::data().

Referenced by CMainLoopThread::Main(), SNetScheduleNotificationThread::Main(), CJobCommitterThread::Main(), CThreadInPool_ForServer::Main(), CThreadInPool< TRequest >::Main(), CAsyncTaskProcessor< TTask >::CExecutor::SThread::Main(), CGetJobNotificationThread::Main(), CServiceThread::Main(), CJobQueueCleanerThread::Main(), CJobQueueExecutionWatcherThread::Main(), CNSTDBConnectionThread::Main(), CNetStorageServiceThread::Main(), CGridControlThread::Main(), CWorkerNodeIdleThread::Main(), and CAsyncDiagThread::Main().

◆ SetId()

template<class TLockVect >

◆ SetValue() [1/2] ◆ SetValue() [2/2]

Set value.

Cleanup previously stored value, and set the new value. The "cleanup" function and "cleanup_data" will be used to destroy the new "value" in the next call to SetValue() or Reset(). Do not cleanup if the new value is equal to the old one.

Parameters
value New value to set. cleanup Cleanup function. Do not cleanup if default of 0 is specified or if new value is the same as old value. cleanup_data One of the parameters to the cleanup function.
See also
GetValue()

Definition at line 203 of file ncbithr.hpp.

Referenced by CCgiApplication::x_CreateProcessor(), and CLDS2_UrlHandler_File::x_GetStreamCache().

◆ SetWaitForAllThreadsTimeout() void CThread::SetWaitForAllThreadsTimeout ( const CTimeouttimeout ) static ◆ SignalAll() void CConditionVariable::SignalAll ( void  ) ◆ SignalSome() void CConditionVariable::SignalSome ( void  ) ◆ TakeFrom() ◆ ThrowLockFailed() void SSystemFastMutex::ThrowLockFailed ( void  ) static ◆ ThrowNotOwned() void SSystemMutex::ThrowNotOwned ( void  ) static ◆ ThrowTryLockFailed() void SSystemFastMutex::ThrowTryLockFailed ( void  ) static ◆ ThrowUninitialized() void SSystemFastMutex::ThrowUninitialized ( void  ) static ◆ ThrowUnlockFailed() void SSystemFastMutex::ThrowUnlockFailed ( void  ) static ◆ ToVoidP() [1/2]

template<class V >

template<class A >

Definition at line 256 of file ncbithr.hpp.

◆ ToVoidP() [2/2]

template<class V >

template<class A >

Definition at line 248 of file ncbithr.hpp.

◆ TryLock() [1/6] ◆ TryLock() [2/6] bool SSystemFastMutex::TryLock ( void  ) ◆ TryLock() [3/6] bool SSystemMutex::TryLock ( void  ) ◆ TryLock() [4/6] bool CFastMutex::TryLock ( void  )

Try locking the mutex.

◆ TryLock() [5/6] bool CMutex::TryLock ( void  ) ◆ TryLock() [6/6] bool CSpinLock::TryLock ( void  ) ◆ TryReadLock() [1/2]

Try read lock with timeout.

Parameters
timeout Timeout for the read lock attempt.
Returns
TRUE if the R-lock has been successfully acquired; FALSE, otherwise.

Definition at line 1050 of file ncbimtx.cpp.

References _VERIFY, CRWLock::fTrackReaders, CTimeout::GetAsMilliSeconds(), GetCurrentThreadSystemID(), CDeadline::GetExpirationTime(), CTimeout::GetNano(), HANDLE, interlocked_dec_max(), interlocked_inc_min(), CTimeout::IsInfinite(), CTimeout::IsZero(), CRWLock::m_Count, CRWLock::m_Flags, CRWLock::m_Owner, CRWLock::m_Readers, CRWLock::m_RW, CRWLock::m_WaitingWriters, ok, CRWLock::ReadLock(), TRUE, CRWLock::TryReadLock(), CRWLock::x_MayAcquireForReading(), xncbi_Validate, and xncbi_ValidateAndErrnoReport.

◆ TryReadLock() [2/2] bool CRWLock::TryReadLock ( void  )

Try read lock.

Try to acquire R-lock and return immediately.

Returns
TRUE if the R-lock has been successfully acquired; FALSE, otherwise.

Definition at line 976 of file ncbimtx.cpp.

References _VERIFY, CRWLock::fTrackReaders, GetCurrentThreadSystemID(), interlocked_dec_max(), interlocked_inc_min(), CRWLock::m_Count, CRWLock::m_Flags, CRWLock::m_Owner, CRWLock::m_Readers, CRWLock::m_RW, CRWLock::x_MayAcquireForReading(), and xncbi_Validate.

Referenced by s_LOCK_Handler(), and CRWLock::TryReadLock().

◆ TryWait() [1/2] ◆ TryWait() [2/2] bool CSemaphore::TryWait ( unsigned int  timeout_sec = 0, unsigned int  timeout_nsec = 0  )

Timed wait.

Wait up to timeout_sec + timeout_nsec/1E9 seconds for the semaphore's count to exceed zero. If that happens, decrement the counter by one and return TRUE; otherwise, return FALSE.

Definition at line 1844 of file ncbimtx.cpp.

References SSemaphore::cond, SSemaphore::count, gettimeofday(), kMax_Int, CSemaphore::m_Sem, SSemaphore::mutex, SSemaphore::wait_count, xncbi_Validate, and xncbi_ValidatePthread.

Referenced by SGridWorkerNodeImpl::EnterExclusiveMode(), CBDB_Cache::EvaluateTimeLine(), SServerNotifications::GetNextNotification(), SServerNotifications::InterruptWait(), CThreadNonStop::Main(), CGetJobNotificationThread::Main(), CJobQueueCleanerThread::Main(), CJobQueueExecutionWatcherThread::Main(), CWorkerNodeIdleThread::Main(), CScheduler_ExecThread_Impl::Main(), impl::CDriverContext::MakePooledConnection(), CBDB_Cache::Purge(), CSemaphore::TryWait(), CGridCleanupThread::Wait(), SGridWorkerNodeImpl::WaitForExclusiveJobToFinish(), CJobCommitterThread::WaitForTimeout(), CNSTDBConnectionThread::x_CreateDatabase(), CThreadPool_ServiceThread::x_Idle(), CSyncQueue< Type, Container, Traits >::x_LockAndWait(), impl::CDriverContext::x_Recycle(), CNSTDBConnectionThread::x_RestoreConnection(), CBlockingQueue< TRequest >::x_WaitForPredicate(), CThreadPool_Impl::x_WaitForPredicate(), and CSchedulerEngine::x_WorkOnThread().

◆ TryWriteLock() [1/2]

Try write lock with timeout.

Parameters
timeout Timeout for the write lock attempt.
Returns
TRUE if the W-lock has been successfully acquired; FALSE, otherwise.

Definition at line 1386 of file ncbimtx.cpp.

References _ASSERT, _VERIFY, CRWLock::fFavorWriters, CTimeout::GetAsMilliSeconds(), GetCurrentThreadSystemID(), CDeadline::GetExpirationTime(), CTimeout::GetNano(), HANDLE, interlocked_dec_max(), interlocked_set(), CTimeout::IsInfinite(), CTimeout::IsZero(), CRWLock::m_Count, CRWLock::m_Flags, CRWLock::m_Owner, CRWLock::m_Readers, CRWLock::m_RW, CRWLock::m_WaitingWriters, ok, TRUE, CRWLock::TryWriteLock(), CRWLock::WriteLock(), xncbi_Validate, and xncbi_ValidateAndErrnoReport.

◆ TryWriteLock() [2/2] bool CRWLock::TryWriteLock ( void  )

Try write lock.

Try to acquire W-lock and return immediately.

Returns
TRUE if the W-lock has been successfully acquired; FALSE, otherwise.

Definition at line 1320 of file ncbimtx.cpp.

References _ASSERT, _VERIFY, GetCurrentThreadSystemID(), HANDLE, interlocked_dec_max(), interlocked_set(), CRWLock::m_Count, CRWLock::m_Owner, CRWLock::m_Readers, CRWLock::m_RW, TRUE, and xncbi_Validate.

Referenced by s_LOCK_Handler(), and CRWLock::TryWriteLock().

◆ Unlock() [1/8]

template<class TLockVect >

◆ Unlock() [2/8] ◆ Unlock() [3/8] ◆ Unlock() [4/8]

Unlock object.

Returns
TRUE if object unlocked successfully, FALSE if it was not locked

Definition at line 304 of file lock_vector.hpp.

References _ASSERT.

◆ Unlock() [5/8] void CFastMutex::Unlock ( void  )

Release mutex with no owner or nesting checks.

Referenced by CRtProfiler::AddMarkerMT(), CRtProfiler::AddUserKVMT(), CRtProfiler::AsStringMT(), BlastLockHandler(), CBlastAsyncFormatThread::Finalize(), CServer_ConnectionPool::GetListenerPorts(), CServer_ConnectionPool::GetPollAndTimerVec(), CBlastAsyncFormatThread::Main(), CBlastKmerThread::Main(), CBlastAsyncFormatThread::QueueResults(), CFastRWLock::ReadLock(), CServer_ConnectionPool::RemoveListener(), CServer_ConnectionPool::SetAllActive(), CRtProfiler::StartMT(), CRtProfiler::StopMT(), CThreadGroup::SyncPoint(), CBDB_Cache::Unlock(), CDBConnectionFactory::CServiceInfo::Unlock(), CConditionVariable::WaitForSignal(), CFastRWLock::WriteUnlock(), CNCMMCentral::x_DoBackgroundWork(), and CNSTDBConnectionThread::x_RestoreConnection().

◆ Unlock() [6/8] void CMutex::Unlock ( void  ) ◆ Unlock() [7/8] void CSpinLock::Unlock ( void  )

Unlock the mutex.

There's no check that mutex is unlocked by the same thread that locked it.

Definition at line 2342 of file ncbimtx.cpp.

References _VERIFY, CSpinLock::m_Value, NULL, and SwapPointers().

Referenced by CObjPool< CRWLockHolder, THolderPoolFactory >::Clear(), CObjPool< CRWLockHolder, THolderPoolFactory >::Get(), CObjPool< CRWLockHolder, THolderPoolFactory >::Return(), CRWLockHolder::x_OnLockAcquired(), and CRWLockHolder::x_OnLockReleased().

◆ Unlock() [8/8] void CRWLock::Unlock ( void  )

Release the RW-lock.

Definition at line 1558 of file ncbimtx.cpp.

References _ASSERT, _VERIFY, cnt, CRWLock::fTrackReaders, GetCurrentThreadSystemID(), interlocked_dec_min(), interlocked_inc_max(), CRWLock::m_Count, CRWLock::m_Flags, CRWLock::m_Owner, CRWLock::m_Readers, CRWLock::m_RW, CRWLock::m_WaitingWriters, xncbi_Validate, and xncbi_ValidatePthread.

Referenced by s_LOCK_Handler(), and IRegistry::Unlock().

◆ Wait() void CSemaphore::Wait ( void  )

Wait on semaphore.

Decrement the counter by one. If the semaphore's count is zero then wait until it's not zero.

Definition at line 1787 of file ncbimtx.cpp.

References SSemaphore::cond, SSemaphore::count, CSemaphore::m_Sem, SSemaphore::mutex, SSemaphore::wait_count, xncbi_Validate, and xncbi_ValidatePthread.

Referenced by CPSGL_QueueGuard::GetNextResult(), CTestThread::GlobalSyncPoint(), CJobCommitterThread::Main(), CBlastAsyncFormatThread::Main(), CPrefetchThreadOld::Main(), CNSTDBConnectionThread::Main(), CAsyncDiagThread::Main(), CThreadPool_ServiceThread::Main(), CIStreamObjectIteratorThread< TRoot, TObject >::Main(), CIStreamStdIteratorThread< TRoot, TObject >::Main(), CIStreamIteratorThread_Base< TRoot, TObject >::Next(), CIStreamIteratorThread_Base< TRoot, TObject >::SetObject(), CThreadGroup::SyncPoint(), CThreadGroup::ThreadWait(), CSemaphore::TryWait(), CPSGL_RequestTracker::WaitForBackgroundTasks(), CReader::x_AllocConnection(), CThreadPool_ThreadImpl::x_Idle(), CSyncQueue< Type, Container, Traits >::x_LockAndWait(), and CThreadPool_Impl::x_WaitForPredicate().

◆ WaitForAllThreads() bool CThread::WaitForAllThreads ( void  ) staticprivate ◆ WaitForSignal() [1/2]

Release mutex and lock the calling thread until the condition variable is signalled.

Parameters
mutex Mutex to release while waiting for a signal. At the time of the call the mutex must be locked by this thread. Otherwise, an exception will be thrown. deadline The wait will time out when system time equals or exceeds the absolute time specified in 'deadline'
Returns
TRUE when condition variable is signalled; FALSE if timed out
See also
SignalSome, SignalAll, CConditionVariableException

Definition at line 2579 of file ncbimtx.cpp.

References CFastMutex::Unlock(), and CConditionVariable::x_WaitForSignal().

◆ WaitForSignal() [2/2] ◆ Wrapper()

Function to use (internally) as the thread's startup function.

Definition at line 552 of file ncbithr.cpp.

References CUsedTlsBases::ClearAllCurrentThread(), CExitThreadException::EnterWrapper(), CThread::IsMain(), CThread::m_ExitData, CThread::m_IsDetached, CThread::m_IsTerminated, CThread::m_ParentRequestContext, CThread::m_SelfRef, CThread::Main(), NCBI_CATCH_ALL_X, NCBI_CATCH_X, CThread::OnExit(), CRef< C, Locker >::Reset(), CDiagContext::SetRequestContext(), CThread::sm_ThreadsCount, CThread::x_InitializeThreadId(), and xncbi_Validate.

Referenced by CThread::Run(), and ThreadWrapperCaller().

◆ WriteLock() [1/2] void CRWLock::WriteLock ( void  )

Write lock.

Acquire the W-lock. If R-lock or W-lock is already acquired by another thread, then wait until it is released.

Definition at line 1201 of file ncbimtx.cpp.

References _ASSERT, _VERIFY, CRWLock::fFavorWriters, GetCurrentThreadSystemID(), HANDLE, interlocked_dec_max(), interlocked_set(), CRWLock::m_Count, CRWLock::m_Flags, CRWLock::m_Owner, CRWLock::m_Readers, CRWLock::m_RW, CRWLock::m_WaitingWriters, TRUE, xncbi_Validate, xncbi_ValidateAndErrnoReport, and xncbi_ValidatePthread.

Referenced by s_LOCK_Handler(), CRWLock::TryWriteLock(), and IRegistry::WriteLock().

◆ WriteLock() [2/2] void CFastRWLock::WriteLock ( void  ) ◆ WriteUnlock() void CFastRWLock::WriteUnlock ( void  ) ◆ x_CleanupThreadCallback() void CTlsBase::x_CleanupThreadCallback ( void *  ptr ) staticprivate ◆ x_DeleteTlsData() ◆ x_Destroy() void CTlsBase::x_Destroy ( void  ) protected ◆ x_GetKey() ◆ x_GetKeyLong() ◆ x_GetTlsData() ◆ x_GetValue() void * CTlsBase::x_GetValue ( void  ) const inlineprotected ◆ x_Init() void CTlsBase::x_Init ( void  ) protected ◆ x_InitializeThreadId() void CThread::x_InitializeThreadId ( void  ) private ◆ x_MayAcquireForReading() ◆ x_OnLockAcquired() void CRWLockHolder::x_OnLockAcquired ( void  ) private ◆ x_OnLockReleased() void CRWLockHolder::x_OnLockReleased ( void  ) private ◆ x_ReleaseLock()

Main implementation releasing lock.

Definition at line 2265 of file ncbimtx.cpp.

References eReadLock, eWriteLock, CRWLockHolder::m_LockAcquired, CYieldingRWLock::m_Locks, CYieldingRWLock::m_LockWaits, CYieldingRWLock::m_ObjLock, CRWLockHolder::m_Type, NON_CONST_ITERATE, CRef< C, Locker >::NotNull(), and CRWLockHolder::x_OnLockReleased().

◆ x_Reset() void CTlsBase::x_Reset ( void  ) protected ◆ x_SetValue()

Helper method to set thread data.

Definition at line 274 of file ncbithr.cpp.

References cleanup(), CTlsBase::CleanupTlsData(), CTlsBase::eSkipCleanup, CUsedTlsBases::GetUsedTlsBases(), CTlsBase::STlsData::m_CleanupData, CTlsBase::STlsData::m_CleanupFunc, CTlsBase::m_Initialized, CTlsBase::m_Key, CTlsBase::STlsData::m_Native, CTlsBase::STlsData::m_Value, CUsedTlsBases::Register(), s_TlsSetValue(), rapidjson::value, CTlsBase::x_GetTlsData(), and xncbi_Validate.

Referenced by CTls< CCgiRequestProcessor >::SetValue().

◆ x_WaitForSignal() bool CConditionVariable::x_WaitForSignal ( SSystemFastMutex &  mutex, const CDeadlinetimeout  ) private ◆ ~CConditionVariable() CConditionVariable::~CConditionVariable ( void  ) ◆ ~CFastMutex() CFastMutex::~CFastMutex ( void  )

Destructor.

Close mutex handle. No checks if it's still acquired.

◆ ~CFastRWLock() CFastRWLock::~CFastRWLock ( void  ) ◆ ~CLockVector() ◆ ~CLockVectorGuard()

template<class TLockVect >

◆ ~CMutex()

Destructor.

Report error if the mutex is locked.

◆ ~CRWLock() CRWLock::~CRWLock ( void  ) ◆ ~CRWLockHolder() CRWLockHolder::~CRWLockHolder ( void  ) virtual ◆ ~CSemaphore() CSemaphore::~CSemaphore ( void  ) ◆ ~CSpinLock() CSpinLock::~CSpinLock ( void  ) ◆ ~CThread() CThread::~CThread ( void  ) protectedvirtual ◆ ~CTlsBase() CTlsBase::~CTlsBase ( void  ) inlineprotected ◆ ~CUsedTlsBases() CUsedTlsBases::~CUsedTlsBases ( void  )

Definition at line 77 of file ncbithr.cpp.

◆ ~CYieldingRWLock() CYieldingRWLock::~CYieldingRWLock ( void  ) ◆ ~IRWLockHolder_Factory() IRWLockHolder_Factory::~IRWLockHolder_Factory ( void  ) virtual

Definition at line 2100 of file ncbimtx.cpp.

◆ ~IRWLockHolder_Listener() IRWLockHolder_Listener::~IRWLockHolder_Listener ( void  ) virtual

Definition at line 2097 of file ncbimtx.cpp.

◆ kThreadID_None ◆ m_AutoDestroy bool CTlsBase::m_AutoDestroy private ◆ m_Cleanup ◆ m_CleanupData void* CTlsBase::STlsData::m_CleanupData ◆ m_CleanupFunc ◆ m_ConditionVar CONDITION_VARIABLE CConditionVariable::m_ConditionVar private ◆ m_Count [1/2] atomic<int> ncbi_namespace_mutex_mt::SSystemMutex::m_Count

# of recursive (in the same thread) locks

Definition at line 415 of file ncbimtx.hpp.

◆ m_Count [2/2] volatile long CRWLock::m_Count private ◆ m_ExitData void* CThread::m_ExitData private ◆ m_Factory [1/2] ◆ m_Factory [2/2] ◆ m_Flags ◆ m_Handle [1/2] TSystemMutex ncbi_namespace_mutex_mt::SSystemFastMutex::m_Handle ◆ m_Handle [2/2] ◆ m_ID TID CThreadSystemID::m_ID ◆ m_Id

template<class TLockVect >

◆ m_IdVector ◆ m_IdVector_Lock ◆ m_Initialized bool CTlsBase::m_Initialized private ◆ m_IsDetached bool CThread::m_IsDetached private ◆ m_IsJoined ◆ m_IsRun ◆ m_IsTerminated bool CThread::m_IsTerminated private ◆ m_Key [1/2] ◆ m_Key [2/2] ◆ m_Listeners ◆ m_Lock ◆ m_LockAcquired bool CRWLockHolder::m_LockAcquired private ◆ m_LockCount ◆ m_Locks int CYieldingRWLock::m_Locks[2] private ◆ m_LockSet

template<class TLockVect >

◆ m_LockVector

template<class TLockVect >

◆ m_LockWaits ◆ m_Magic volatile EMagic ncbi_namespace_mutex_mt::SSystemFastMutex::m_Magic ◆ m_Mutex [1/3] ◆ m_Mutex [2/3] SSystemFastMutex CFastMutex::m_Mutex private ◆ m_Mutex [3/3] SSystemMutex CMutex::m_Mutex private ◆ m_Native ◆ m_ObjLock [1/2] ◆ m_ObjLock [2/2] ◆ m_Owner [1/2]

Platform-dependent owner thread ID.

Definition at line 413 of file ncbimtx.hpp.

◆ m_Owner [2/2] ◆ m_ParentRequestContext ◆ m_Readers ◆ m_RW ◆ m_SelfRef ◆ m_Sem ◆ m_Spins ◆ m_Timeout

template<class TLockVect >

◆ m_Type ◆ m_UsedTls ◆ m_Value [1/2] void* volatile CSpinLock::m_Value private ◆ m_Value [2/2] void* CTlsBase::STlsData::m_Value ◆ m_WaitCounter ◆ m_WaitingWriters volatile unsigned int CRWLock::m_WaitingWriters private ◆ m_WaitMutex SSystemFastMutex* volatile CConditionVariable::m_WaitMutex private ◆ m_WriteLock ◆ sm_IsExiting ◆ sm_ThreadsCount atomic< unsigned int > CThread::sm_ThreadsCount staticprivate ◆ sm_UsedTlsBases ◆ sm_WaitForThreadsTimeout ◆ ::ncbi::CAutoInitializeStaticFastMutex friend class ::ncbi::CAutoInitializeStaticFastMutex friend

Definition at line 377 of file ncbimtx.hpp.

◆ ::ncbi::CAutoInitializeStaticMutex friend class ::ncbi::CAutoInitializeStaticMutex friend

Definition at line 472 of file ncbimtx.hpp.

◆ ::ncbi::CFastMutex friend class ::ncbi::CFastMutex friend

Definition at line 378 of file ncbimtx.hpp.

◆ ::ncbi::CMutex friend class ::ncbi::CMutex friend

Definition at line 473 of file ncbimtx.hpp.

◆ ::ncbi::CSafeStaticPtr_Base friend class ::ncbi::CSafeStaticPtr_Base friend

Definition at line 379 of file ncbimtx.hpp.

◆ CNcbiApplicationAPI ◆ CRef< CThread > ◆ CRef< CTlsBase > ◆ CRWLock [1/2] ◆ CRWLock [2/2]

Allow use of m_Mtx and m_Owner members directly.

Definition at line 807 of file ncbimtx.hpp.

◆ CRWLockHolder ◆ CStaticTlsHelper friend class CStaticTlsHelper friend

Definition at line 69 of file ncbithr.hpp.

◆ CTlsBase ◆ CUsedTlsBases [1/2] ◆ CUsedTlsBases [2/2] ◆ CYieldingRWLock ◆ SSystemMutex ◆ ThreadWrapperCaller

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