vdr 2.8.3
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

cStateLock * stateLock
bool write
int state
bool timedOut

Friends

class cStateLock

Detailed Description

Definition at line 247 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 882 of file thread.c.

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

◆ ~cStateKey()

cStateKey::~cStateKey ( )

Definition at line 891 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 274 of file thread.h.

References stateLock.

◆ Remove()

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

References state.

Referenced by cStateKey(), cMenuChannels::Delete(), main(), cMenuTimers::ProcessKey(), cMenuChannels::Set(), cMenuRecordings::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 914 of file thread.c.

References ABORT, esyslog, state, cStateLock::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 276 of file thread.h.

References timedOut.

Referenced by cSVDRPClientHandler::ProcessConnections().

◆ cStateLock

friend class cStateLock
friend

Definition at line 248 of file thread.h.

References cStateLock.

Referenced by cStateLock.

Member Data Documentation

◆ state

int cStateKey::state
private

Definition at line 252 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 253 of file thread.h.

Referenced by cStateLock::Lock(), and TimedOut().

◆ write

bool cStateKey::write
private

Definition at line 251 of file thread.h.

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


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