CThreadPool_Guard Class Reference

Search Toolkit Book for CThreadPool_Guard

Inheritance diagram for CThreadPool_Guard:

Inheritance graph
[legend]
Collaboration diagram for CThreadPool_Guard:

Collaboration graph
[legend]
List of all members.

Detailed Description

Guardian for protecting pool by locking its main mutex.

Definition at line 548 of file thread_pool.cpp.

Public Member Functions

 CThreadPool_Guard (CThreadPool_Impl *pool, bool is_active=true)
 Constructor.
void Guard (void)
 Turn this guardian on.
void Release (void)
 Turn this guardian off.

Private Attributes

CThreadPool_Implm_Pool
 Pool protected by the guardian.


Constructor & Destructor Documentation

CThreadPool_Guard::CThreadPool_Guard CThreadPool_Impl pool,
bool  is_active = true
 

Constructor.

Parameters:
pool Pool to protect
is_active If the mutex should be locked in constructor or not

Definition at line 655 of file thread_pool.cpp.

References _ASSERT, and Guard().


Member Function Documentation

void CThreadPool_Guard::Guard void   ) 
 

Turn this guardian on.

Definition at line 666 of file thread_pool.cpp.

References CThreadPool_Impl::GetMainPoolMutex(), CGuard< SSystemMutex >::Guard(), and m_Pool.

Referenced by CThreadPool_Impl::AddTask(), CThreadPool_Guard(), CThreadPool_Controller::SetMaxThreads(), CThreadPool_Controller::SetMinThreads(), CThreadPool_ServiceThread::x_WaitForPoolStop(), and CThreadPool_Impl::x_WaitForPredicate().

void CThreadPool_Guard::Release void   ) 
 

Turn this guardian off.

Reimplemented from CGuard< SSystemMutex >.

Definition at line 672 of file thread_pool.cpp.

References CGuard< SSystemMutex >::Release().

Referenced by CThreadPool_ServiceThread::x_WaitForPoolStop(), and CThreadPool_Impl::x_WaitForPredicate().


Member Data Documentation

CThreadPool_Impl* CThreadPool_Guard::m_Pool [private]
 

Pool protected by the guardian.

Definition at line 566 of file thread_pool.cpp.

Referenced by Guard().


The documentation for this class was generated from the following file:
Generated on Wed Dec 9 08:11:31 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:20:06 2009 by modify_doxy.py rev. 173732