vdr 2.6.7
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)
 
bool InLock (void)
 
bool TimedOut (void) const
 

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 845 of file thread.c.

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

◆ ~cStateKey()

cStateKey::~cStateKey ( )

Definition at line 854 of file thread.c.

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

Member Function Documentation

◆ InLock()

bool cStateKey::InLock ( void )
inline

Returns true if this key is currently in a lock.

Definition at line 260 of file thread.h.

References stateLock.

◆ 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 862 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 877 of file thread.c.

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

Referenced by main().

◆ TimedOut()

bool cStateKey::TimedOut ( void ) const
inline

Returns true if the last lock attempt this key was used with failed due to a timeout.

Definition at line 262 of file thread.h.

References timedOut.

Referenced by cSVDRPClientHandler::ProcessConnections().

Friends And Related Symbol 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(), and TimedOut().

◆ 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: