+ /**
+ * Unlock the mutex associated with a lock and wait for another thread
+ * to notify the thread, at which point the lock will be re-locked and
+ * the method will return. If the thread was not notified before a
+ * certain number of seconds, the method will return anyway.
+ * \param lock The lock.
+ * \param timeout Number of seconds to wait.
+ * \return True if the thread was notified, false otherwise.
+ */
+ bool wait(Mutex::Lock& lock, Scalar timeout)
+ {
+ Uint32 ms = timeout * SCALAR(1000.0);
+ return (SDL_CondWaitTimeout(mCondition,
+ lock.mMutex.mMutex, ms) == 0);
+ }
+
+
+ /**
+ * Notify one other thread that is waiting on the condition.
+ * \return True on success, false otherwise.
+ */