#include <itkSimpleFastMutexLock.h>

Public Types | |
| typedef SimpleFastMutexLock | Self |
Public Member Functions | |
| SimpleFastMutexLock () | |
| void | Lock () const |
| void | Unlock () const |
Protected Attributes | |
| FastMutexType | m_FastMutexLock |
SimpleFastMutexLock is used by FastMutexLock to perform mutex locking. SimpleFastMutexLock is not a subclass of Object and is designed to be allocated on the stack.
Definition at line 74 of file itkSimpleFastMutexLock.h.
Standard class typedefs.
Definition at line 78 of file itkSimpleFastMutexLock.h.
| itk::SimpleFastMutexLock::SimpleFastMutexLock | ( | ) |
Constructor and destructor left public purposely because of stack allocation.
Definition at line 26 of file itkSimpleFastMutexLock.cxx.
00027 { 00028 #ifdef ITK_USE_SPROC 00029 init_lock( &m_FastMutexLock ); 00030 #endif 00031 00032 #if defined(_WIN32) && !defined(ITK_USE_PTHREADS) 00033 //this->MutexLock = CreateMutex( NULL, FALSE, NULL ); 00034 InitializeCriticalSection(&m_FastMutexLock); 00035 #endif 00036 00037 #ifdef ITK_USE_PTHREADS 00038 #ifdef ITK_HP_PTHREADS 00039 pthread_mutex_init(&(m_FastMutexLock), pthread_mutexattr_default); 00040 #else 00041 pthread_mutex_init(&(m_FastMutexLock), NULL); 00042 #endif 00043 #endif 00044 00045 }
| void itk::SimpleFastMutexLock::Lock | ( | void | ) | const |
Lock access.
Definition at line 61 of file itkSimpleFastMutexLock.cxx.
Referenced by itk::LoggerThreadWrapper< SimpleLoggerType >::AddLogOutput(), itk::ThreadLogger::AddLogOutput(), itk::LoggerThreadWrapper< SimpleLoggerType >::GetPriorityLevel(), itk::ThreadLogger::GetPriorityLevel(), itk::FastMutexLock::Lock(), itk::LoggerThreadWrapper< SimpleLoggerType >::LoggerThreadWrapper(), itk::TimeStamp::Modified(), itk::LightObject::Register(), itk::fem::FEMObjectFactory< itk::fem::FEMLightObject >::Register(), itk::fem::VisitorDispatcher< TVisitedClass, TVisitorBase, TVisitFunctionPointerType >::RegisterVisitor(), itk::LoggerThreadWrapper< SimpleLoggerType >::SetPriorityLevel(), itk::ThreadLogger::SetPriorityLevel(), itk::LightObject::SetReferenceCount(), itk::ThreadLogger::ThreadLogger(), and itk::LightObject::UnRegister().
00062 { 00063 #ifdef ITK_USE_SPROC 00064 spin_lock( &m_FastMutexLock ); 00065 #endif 00066 00067 #if defined(_WIN32) && !defined(ITK_USE_PTHREADS) 00068 //WaitForSingleObject( this->MutexLock, INFINITE ); 00069 EnterCriticalSection(&m_FastMutexLock); 00070 #endif 00071 00072 #ifdef ITK_USE_PTHREADS 00073 pthread_mutex_lock( &m_FastMutexLock); 00074 #endif 00075 }
| void itk::SimpleFastMutexLock::Unlock | ( | void | ) | const |
Unlock access.
Definition at line 78 of file itkSimpleFastMutexLock.cxx.
Referenced by itk::ThreadLogger::AddLogOutput(), itk::LoggerThreadWrapper< SimpleLoggerType >::AddLogOutput(), itk::LoggerThreadWrapper< SimpleLoggerType >::GetPriorityLevel(), itk::ThreadLogger::GetPriorityLevel(), itk::TimeStamp::Modified(), itk::LightObject::Register(), itk::fem::FEMObjectFactory< itk::fem::FEMLightObject >::Register(), itk::fem::VisitorDispatcher< TVisitedClass, TVisitorBase, TVisitFunctionPointerType >::RegisterVisitor(), itk::LoggerThreadWrapper< SimpleLoggerType >::SetPriorityLevel(), itk::ThreadLogger::SetPriorityLevel(), itk::LightObject::SetReferenceCount(), itk::FastMutexLock::Unlock(), itk::LightObject::UnRegister(), itk::LoggerThreadWrapper< SimpleLoggerType >::~LoggerThreadWrapper(), and itk::ThreadLogger::~ThreadLogger().
00079 { 00080 #ifdef ITK_USE_SPROC 00081 release_lock( &m_FastMutexLock ); 00082 #endif 00083 00084 #if defined(_WIN32) && !defined(ITK_USE_PTHREADS) 00085 //ReleaseMutex( this->MutexLock ); 00086 LeaveCriticalSection(&m_FastMutexLock); 00087 #endif 00088 00089 #ifdef ITK_USE_PTHREADS 00090 pthread_mutex_unlock( &m_FastMutexLock); 00091 #endif 00092 }