@@ -14,10 +14,12 @@ * file. */ #import "OFMutex.h" +@class OFDate; + /*! * @brief A class implementing a condition variable for thread synchronization. */ @interface OFCondition: OFMutex { @@ -36,10 +38,28 @@ * @brief Blocks the current thread until another thread calls @ref signal or * @ref broadcast. */ - (void)wait; +/*! + * @brief Blocks the current thread until another thread calls @ref signal, + * @ref broadcast or the timeout is reached. + * + * @param timeInterval The time interval until the timeout is reached + * @return Whether the condition has been signaled + */ +- (bool)waitForTimeInterval: (double)timeInterval; + +/*! + * @brief Blocks the current thread until another thread calls @ref signal, + * @ref broadcast or the timeout is reached. + * + * @param date The date at which the timeout is reached + * @return Whether the condition has been signaled + */ +- (bool)waitUntilDate: (OFDate*)date; + /*! * @brief Signals the next waiting thread to continue. */ - (void)signal;