vdr 2.8.3
cMutex Class Reference

#include <thread.h>

Public Member Functions

 cMutex (void)
 ~cMutex ()
bool Lock (int TimeoutMs=0, bool *TimedOut=NULL)
void Unlock (void)

Private Attributes

pthread_mutex_t mutex
std::atomic< tThreadId > lockThreadId
int locked

Friends

class cCondVar

Detailed Description

Definition at line 68 of file thread.h.

Constructor & Destructor Documentation

◆ cMutex()

cMutex::cMutex ( void )

Definition at line 213 of file thread.c.

References locked, lockThreadId, and mutex.

◆ ~cMutex()

cMutex::~cMutex ( )

Definition at line 223 of file thread.c.

References mutex.

Member Function Documentation

◆ Lock()

bool cMutex::Lock ( int TimeoutMs = 0,
bool * TimedOut = NULL )

Returns true if the mutex was successfully locked.

If TimeoutMs is greater than 0, waits up to the given number of milliseconds before giving up and returning false. If TimeoutMs is 0, waits indefinitely. If TimedOut is given, it will be set to true if the function returns false because of a timeout.

Definition at line 228 of file thread.c.

References GetAbsTime(), locked, lockThreadId, mutex, and cThread::ThreadId().

Referenced by cIoThrottle::Activate(), cEpgHandler::cEpgHandler(), cStatus::cStatus(), cTDT::cTDT(), cVideoDirectory::Current(), cVideoDirectory::cVideoDirectory(), cEvent::DecNumTimers(), cSchedule::DecNumTimers(), cSchedule::DelEvent(), cDevice::Detach(), cDvbTuner::ExecuteDiseqc(), cEvent::IncNumTimers(), cSchedule::IncNumTimers(), cMutexLock::Lock(), cPixmap::Lock(), cRingBufferFrame::Lock(), cThread::Lock(), cSkins::ProcessQueuedMessages(), cSkins::QueueMessage(), cIoThrottle::Release(), cEpgHandler::~cEpgHandler(), cStatus::~cStatus(), and cVideoDirectory::~cVideoDirectory().

◆ Unlock()

◆ cCondVar

friend class cCondVar
friend

Definition at line 69 of file thread.h.

References cCondVar.

Referenced by cCondVar.

Member Data Documentation

◆ locked

int cMutex::locked
private

Definition at line 73 of file thread.h.

Referenced by cMutex(), Lock(), cCondVar::TimedWait(), Unlock(), and cCondVar::Wait().

◆ lockThreadId

std::atomic<tThreadId> cMutex::lockThreadId
private

Definition at line 72 of file thread.h.

Referenced by cMutex(), Lock(), cCondVar::TimedWait(), Unlock(), and cCondVar::Wait().

◆ mutex

pthread_mutex_t cMutex::mutex
private

Definition at line 71 of file thread.h.

Referenced by cMutex(), Lock(), cCondVar::TimedWait(), Unlock(), cCondVar::Wait(), and ~cMutex().


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