vdr  2.4.1
Public Member Functions | Private Attributes | Friends | List of all members
cStateKey Class Reference

#include <thread.h>

Public Member Functions

 cStateKey (bool IgnoreFirst=false)
 
 ~cStateKey ()
 
void Reset (void)
 
void Remove (bool IncState=true)
 
bool StateChanged (void)
 

Private Attributes

cStateLockstateLock
 
bool write
 
int state
 
bool timedOut
 

Friends

class cStateLock
 

Detailed Description

Definition at line 233 of file thread.h.

Constructor & Destructor Documentation

◆ cStateKey()

cStateKey::cStateKey ( bool  IgnoreFirst = false)

Sets up a new state key.

If IgnoreFirst is true, the first use of this key with a lock will not return true if the lock's state hasn't explicitly changed.

Definition at line 837 of file thread.c.

References Reset(), state, stateLock, and write.

◆ ~cStateKey()

cStateKey::~cStateKey ( )

Definition at line 846 of file thread.c.

References ABORT, esyslog, cStateLock::name, stateLock, and cStateLock::threadId.

Member Function Documentation

◆ Remove()

void cStateKey::Remove ( bool  IncState = true)

◆ Reset()

void cStateKey::Reset ( void  )

Resets the state of this key, so that the next call to a lock's Lock() function with this key will return true, even if the lock's state hasn't changed.

Definition at line 854 of file thread.c.

References state.

Referenced by cStateKey(), cMenuChannels::Delete(), main(), cMenuChannels::Set(), cMenuSchedule::Set(), cSkinLCARSDisplayMenu::SetMenuCategory(), and cMenuRecordings::Sort().

◆ StateChanged()

bool cStateKey::StateChanged ( void  )

Returns true if this key is used for obtaining a write lock, and the lock's state differs from that of the key.

When used with a read lock, it always returns true, because otherwise the lock wouldn't have been obtained in the first place.

Definition at line 869 of file thread.c.

References ABORT, esyslog, cStateLock::state, state, stateLock, cThread::ThreadId(), and write.

Referenced by main().

Friends And Related Function Documentation

◆ cStateLock

friend class cStateLock
friend

Definition at line 234 of file thread.h.

Member Data Documentation

◆ state

int cStateKey::state
private

Definition at line 238 of file thread.h.

Referenced by cStateKey(), cStateLock::Lock(), Reset(), StateChanged(), and cStateLock::Unlock().

◆ stateLock

cStateLock* cStateKey::stateLock
private

◆ timedOut

bool cStateKey::timedOut
private

Definition at line 239 of file thread.h.

Referenced by cStateLock::Lock().

◆ write

bool cStateKey::write
private

Definition at line 237 of file thread.h.

Referenced by cStateKey(), cStateLock::Lock(), StateChanged(), and cStateLock::Unlock().


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