Remove unused CStdNotifyProc::Check

Günther Brammer 2011-03-17 02:22:33 +01:00
parent 8036211c30
commit 03b3678050
2 changed files with 2 additions and 13 deletions

View File

@ -529,10 +529,9 @@ namespace
#ifdef STDSCHEDULER_USE_EVENTS
CStdNotifyProc::CStdNotifyProc() : Event(true) {}
void CStdNotifyProc::Notify() { Event.Set(); }
bool CStdNotifyProc::Check() { return Event.WaitFor(0); }
bool CStdNotifyProc::CheckAndReset()
{
if (!Check()) return false;
if (!Event.WaitFor(0)) return false;
Event.Reset();
return true;
}
@ -550,14 +549,6 @@ void CStdNotifyProc::Notify()
if (write(fds[1], &c, 1) == -1)
Fail("write failed");
}
bool CStdNotifyProc::Check()
{
fd_set fdset;
FD_ZERO(&fdset);
FD_SET(fds[0], &fdset);
timeval to = { 0, 0 };
return select(fds[0] + 1, &fdset, NULL, NULL, &to);
}
bool CStdNotifyProc::CheckAndReset()
{
bool r = false;

View File

@ -97,10 +97,9 @@ private:
public:
void Set() { iLastTimer = 0; }
void SetDelay(uint32_t inDelay) { iDelay = inDelay; }
bool Check() { return GetTime() >= iLastTimer + iDelay; }
bool CheckAndReset()
{
if (!Check()) return false;
if (GetTime() < iLastTimer + iDelay) return false;
// Compensate light drifting
uint32_t iTime = GetTime();
uint32_t iDrift = iTime - iLastTimer - iDelay; // >= 0 because of Check()
@ -124,7 +123,6 @@ public:
public:
void Notify();
bool Check();
bool CheckAndReset();
#ifdef STDSCHEDULER_USE_EVENTS