diff --git a/doomsday/libdeng2/include/de/concurrency/waitable.h b/doomsday/libdeng2/include/de/concurrency/waitable.h index e692c6a2c2..6c32842ef3 100644 --- a/doomsday/libdeng2/include/de/concurrency/waitable.h +++ b/doomsday/libdeng2/include/de/concurrency/waitable.h @@ -49,19 +49,19 @@ class DENG2_PUBLIC Waitable void reset(); /// Wait until the resource becomes available. Waits indefinitely. - void wait(); + void wait() const; /// Wait for the specified period of time to secure the /// resource. If timeout occurs, an exception is thrown. - void wait(TimeDelta const &timeOut); + void wait(TimeDelta const &timeOut) const; /// Mark the resource as available by incrementing the /// semaphore value. - void post(); + void post() const; private: /// Pointer to the internal semaphore data. - QSemaphore _semaphore; + mutable QSemaphore _semaphore; }; } diff --git a/doomsday/libdeng2/src/concurrency/waitable.cpp b/doomsday/libdeng2/src/concurrency/waitable.cpp index b9cd0e9851..557c9c8cb7 100644 --- a/doomsday/libdeng2/src/concurrency/waitable.cpp +++ b/doomsday/libdeng2/src/concurrency/waitable.cpp @@ -33,12 +33,12 @@ void Waitable::reset() _semaphore.tryAcquire(_semaphore.available()); } -void Waitable::wait() +void Waitable::wait() const { wait(0.0); } -void Waitable::wait(TimeDelta const &timeOut) +void Waitable::wait(TimeDelta const &timeOut) const { if(timeOut <= 0.0) { @@ -55,7 +55,7 @@ void Waitable::wait(TimeDelta const &timeOut) } } -void Waitable::post() +void Waitable::post() const { _semaphore.release(); }