forked from Mirrors/openclonk
Remove unused CStdNotifyProc::Check
parent
8036211c30
commit
03b3678050
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue