|
nux-1.14.0
|
Public Member Functions | |
| NCriticalSection () | |
| ~NCriticalSection () | |
| void | Lock () const |
| Enter critical section. | |
| void | Unlock () const |
| Leave critical section. | |
Definition at line 58 of file ThreadGNU.h.
| nux::NCriticalSection::NCriticalSection | ( | ) | [inline] |
Initialize critical section.
Definition at line 65 of file ThreadGNU.h.
{
pthread_mutex_init (&m_lock, 0);
}
| nux::NCriticalSection::~NCriticalSection | ( | ) | [inline] |
Destroy critical section.
Definition at line 74 of file ThreadGNU.h.
{
pthread_mutex_destroy (&m_lock);
}
| void nux::NCriticalSection::Lock | ( | ) | const [inline] |
Enter critical section.
Enter critical section. This function is made const so it can be used without restriction. For that matter, m_lock is made mutable.
Definition at line 84 of file ThreadGNU.h.
Referenced by nux::NScopeLock::NScopeLock().
{
// NUXTODO: There are issues with locking on Linux when starting nux in embedded mode.,.
#ifndef NUX_OS_LINUX
pthread_mutex_lock (&m_lock);
#endif
}
| void nux::NCriticalSection::Unlock | ( | ) | const [inline] |
Leave critical section.
Leave critical section. This function is made const so it can be used without restriction. For that matter, m_lock is made mutable.
Definition at line 97 of file ThreadGNU.h.
Referenced by nux::NScopeLock::~NScopeLock().
{
// NUXTODO: There are issues with locking on Linux when starting nux in embedded mode.,.
#ifndef NUX_OS_LINUX
pthread_mutex_unlock (&m_lock);
#endif
}