Back to index

nux  3.0.0
Public Member Functions | Private Member Functions | Private Attributes
nux::NCriticalSection Class Reference

#include <ThreadGNU.h>

List of all members.

Public Member Functions

 NCriticalSection ()
 ~NCriticalSection ()
void Lock () const
 Enter critical section.
void Unlock () const
 Leave critical section.

Private Member Functions

 NCriticalSection (const NCriticalSection &)
NCriticalSectionoperator= (const NCriticalSection &)

Private Attributes

pthread_mutex_t m_lock

Detailed Description

Definition at line 58 of file ThreadGNU.h.


Constructor & Destructor Documentation

Initialize critical section.

Definition at line 65 of file ThreadGNU.h.

    {
      pthread_mutex_init (&m_lock, 0);
    }

Destroy critical section.

Definition at line 74 of file ThreadGNU.h.

    {
      pthread_mutex_destroy (&m_lock);
    }

Prohibit copy constructor.


Member Function Documentation

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.

    {
      // NUXTODO: There are issues with locking on Linux when starting nux in embedded mode.,.
#ifndef NUX_OS_LINUX
      pthread_mutex_lock (&m_lock);
#endif
    }

Here is the caller graph for this function:

NCriticalSection& nux::NCriticalSection::operator= ( const NCriticalSection ) [private]

Prohibit assignment operator.

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.

    {
      // NUXTODO: There are issues with locking on Linux when starting nux in embedded mode.,.
#ifndef NUX_OS_LINUX
      pthread_mutex_unlock (&m_lock);
#endif
    }

Here is the caller graph for this function:


Member Data Documentation

pthread_mutex_t nux::NCriticalSection::m_lock [mutable, private]

Definition at line 117 of file ThreadGNU.h.


The documentation for this class was generated from the following file: