|
vdr
2.4.0
|
#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 |
| 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 cStateLock::state.
|
inline |
| void cStateKey::Remove | ( | bool | IncState = true | ) |
Removes this key from the lock it was previously used with.
If this key was used to obtain a write lock, the state of the lock will be incremented and copied to this key. You can set IncState to false to prevent this.
Definition at line 859 of file thread.c.
References ABORT, and esyslog.
Referenced by cDvbPlayer::Action(), cVideoDirectoryScannerThread::Action(), cMenuRecordingEdit::ApplyChanges(), cEIT::cEIT(), cReplayControl::ClearEditingMarks(), cSVDRPServer::CmdPLAY(), cRecordControl::cRecordControl(), cMenuRecordings::Delete(), cMenuChannels::Delete(), cMenuTimers::Delete(), main(), cReplayControl::MarkToggle(), cMenuChannels::Move(), cMenuTimers::OnOff(), cEpgDataWriter::Perform(), cSdtFilter::Process(), cPatFilter::Process(), cEITScanner::Process(), cSVDRPClientHandler::ProcessConnections(), cMenuEditChannel::ProcessKey(), cMenuRecordingEdit::RefreshRecording(), cMenuRecording::RefreshRecording(), cDvbPlayer::Save(), cVideoDirectoryScannerThread::ScanVideoDir(), cMenuFolder::Set(), cMenuRecordings::Set(), cMenuChannels::Set(), cMenuTimers::Set(), cMenuSchedule::Set(), cMenuWhatsOn::Update(), and cMenuSchedule::Update().
| 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 cStateLock::state.
Referenced by cMenuChannels::Delete(), main(), cMenuChannels::Set(), cMenuSchedule::Set(), and cMenuRecordings::Sort().
| 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, cIoThrottle::count, esyslog, cIoThrottle::mutex, cStateLock::state, and cThread::ThreadId().
Referenced by main().
|
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.
Referenced by cSVDRPClientHandler::ProcessConnections().
|
friend |
|
private |
Definition at line 238 of file thread.h.
Referenced by cStateLock::Lock(), and cStateLock::Unlock().
|
private |
Definition at line 236 of file thread.h.
Referenced by cStateLock::Lock(), cStateLock::SetSyncStateKey(), and cStateLock::Unlock().
|
private |
Definition at line 239 of file thread.h.
Referenced by cStateLock::Lock().
|
private |
Definition at line 237 of file thread.h.
Referenced by cStateLock::Lock(), and cStateLock::Unlock().
1.8.11