#include <thread.h>

Definition at line 434 of file thread.h.
Public Member Functions | |
| cmn_ThreadCounter () | |
| int | GetCount () const |
| void | Inc () |
| void | Dec () |
| void | WaitAllEnd () |
Private Attributes | |
| log_CLASSID_m | |
| int | m_threadCounter |
| cmn_Mutex | m_threadCounter_x |
| cmn_Condition | m_allThreadFinished |
| cmn_ThreadCounter::cmn_ThreadCounter | ( | ) |
Definition at line 517 of file cmn_thread.cpp.
00518 : m_threadCounter(0), 00519 m_allThreadFinished(&m_threadCounter_x) { 00520 //empty 00521 }
| int cmn_ThreadCounter::GetCount | ( | ) | const |
Definition at line 524 of file cmn_thread.cpp.
References m_threadCounter, and m_threadCounter_x.
Referenced by i_BackEndAgent_i::Migrate(), and i_BackEndAgent_i::Recall().
00524 { 00525 cmn_MutexLock l(m_threadCounter_x); 00526 return m_threadCounter; 00527 }

| void cmn_ThreadCounter::Inc | ( | ) |
Definition at line 529 of file cmn_thread.cpp.
References m_threadCounter, and m_threadCounter_x.
Referenced by bea_DupReadThread::bea_DupReadThread(), bea_DupWriteThread::bea_DupWriteThread(), bea_FRIThread::bea_FRIThread(), bea_MigrationThread::bea_MigrationThread(), bea_RecallThread::bea_RecallThread(), job_Executor::job_Executor(), pm_FriProcessor::pm_FriProcessor(), and pm_RecallClientThread::pm_RecallClientThread().
00529 { 00530 cmn_MutexLock l(m_threadCounter_x); 00531 m_threadCounter++; 00532 }

| void cmn_ThreadCounter::Dec | ( | ) |
Definition at line 534 of file cmn_thread.cpp.
References cmn_Condition::Broadcast(), ie_DATA_CORRUPTION, log_FUNC_m, m_allThreadFinished, m_threadCounter, and m_threadCounter_x.
Referenced by bea_DupReadThread::~bea_DupReadThread(), bea_DupWriteThread::~bea_DupWriteThread(), bea_FRIThread::~bea_FRIThread(), bea_MigrationThread::~bea_MigrationThread(), bea_RecallThread::~bea_RecallThread(), job_Executor::~job_Executor(), pm_FriProcessor::~pm_FriProcessor(), and pm_RecallClientThread::~pm_RecallClientThread().
00534 { 00535 cmn_MutexLock l(m_threadCounter_x); 00536 00537 if (m_threadCounter < 1) { 00538 log_FUNC_m(Dec); 00539 throw ivd_InternalError(ie_DATA_CORRUPTION, "BUG: Thread counter already < 1."); 00540 } 00541 00542 --m_threadCounter; 00543 if (m_threadCounter == 0) { 00544 m_allThreadFinished.Broadcast(); 00545 } 00546 }


| void cmn_ThreadCounter::WaitAllEnd | ( | ) |
Definition at line 548 of file cmn_thread.cpp.
References cmn_Thread::GetTime(), m_allThreadFinished, m_threadCounter, m_threadCounter_x, and cmn_Condition::TimedWait().
Referenced by i_RecallJob_i::CompleteJob(), i_MaintFriJob_i::CompleteJob(), i_BackEndAgent_i::~i_BackEndAgent_i(), and i_Job_i::~i_Job_i().
00548 { 00549 cmn_MutexLock l(m_threadCounter_x); 00550 while (m_threadCounter > 0) { 00551 m_allThreadFinished.TimedWait(cmn_Thread::GetTime(1)); 00552 } 00553 }


cmn_ThreadCounter::log_CLASSID_m [private] |
int cmn_ThreadCounter::m_threadCounter [private] |
cmn_Mutex cmn_ThreadCounter::m_threadCounter_x [mutable, private] |
1.5.6