From 1a53e42c40a49bfe770086719685d7bf992d4dc6 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Fri, 25 Mar 2011 12:42:12 +0000 Subject: [PATCH] bug 1362: added waitForever() --- RTCP/IONProc/src/WallClockTime.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RTCP/IONProc/src/WallClockTime.h b/RTCP/IONProc/src/WallClockTime.h index 465eae511f6..55e5e60272f 100644 --- a/RTCP/IONProc/src/WallClockTime.h +++ b/RTCP/IONProc/src/WallClockTime.h @@ -43,6 +43,7 @@ class WallClockTime bool waitUntil(const struct timespec &); bool waitUntil(time_t); bool waitUntil(const TimeStamp &); + void waitForever(); void cancelWait(); @@ -84,6 +85,13 @@ inline bool WallClockTime::waitUntil(const TimeStamp ×tamp) return waitUntil(static_cast<struct timespec>(timestamp)); } +inline void WallClockTime::waitForever() +{ + ScopedLock scopedLock(itsMutex); + + while (!itsCancelled) + itsCondition.wait(itsMutex); +} inline void WallClockTime::cancelWait() { -- GitLab