Skip to content
Snippets Groups Projects
Commit 1a53e42c authored by Jan David Mol's avatar Jan David Mol
Browse files

bug 1362: added waitForever()

parent 553d6269
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ class WallClockTime ...@@ -43,6 +43,7 @@ class WallClockTime
bool waitUntil(const struct timespec &); bool waitUntil(const struct timespec &);
bool waitUntil(time_t); bool waitUntil(time_t);
bool waitUntil(const TimeStamp &); bool waitUntil(const TimeStamp &);
void waitForever();
void cancelWait(); void cancelWait();
...@@ -84,6 +85,13 @@ inline bool WallClockTime::waitUntil(const TimeStamp &timestamp) ...@@ -84,6 +85,13 @@ inline bool WallClockTime::waitUntil(const TimeStamp &timestamp)
return waitUntil(static_cast<struct timespec>(timestamp)); return waitUntil(static_cast<struct timespec>(timestamp));
} }
inline void WallClockTime::waitForever()
{
ScopedLock scopedLock(itsMutex);
while (!itsCancelled)
itsCondition.wait(itsMutex);
}
inline void WallClockTime::cancelWait() inline void WallClockTime::cancelWait()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment