diff options
author | David Robillard <d@drobilla.net> | 2007-08-09 05:38:36 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-08-09 05:38:36 +0000 |
commit | 7b3b414258d2f3edae780c53114672560495e502 (patch) | |
tree | 8ed6d4caa391681470e4ef21eedcfaff148b39ce /raul/Semaphore.hpp | |
parent | 464e988e4bb8dcbad6e2332234c3415c6671c7de (diff) | |
download | raul-7b3b414258d2f3edae780c53114672560495e502.tar.gz raul-7b3b414258d2f3edae780c53114672560495e502.tar.bz2 raul-7b3b414258d2f3edae780c53114672560495e502.zip |
Minor threading interface stuff for parallel Ingen.
git-svn-id: http://svn.drobilla.net/lad/raul@690 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul/Semaphore.hpp')
-rw-r--r-- | raul/Semaphore.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/raul/Semaphore.hpp b/raul/Semaphore.hpp index 93dae0a..3bd6ac4 100644 --- a/raul/Semaphore.hpp +++ b/raul/Semaphore.hpp @@ -31,7 +31,8 @@ namespace Raul { * work in GDB. Turns out sem_wait can fail when run in GDB, and Debian * really needs to update it's man pages. * - * This class remains as a trivial (yet pretty) wrapper/abstraction. + * This class remains as a trivial (yet pretty) wrapper/abstraction, because + * Glib (idiotically) doesn't have a Semaphore class. * * \ingroup raul */ @@ -61,9 +62,11 @@ public: /** Non-blocking version of wait(). * + * \return true if decrement was successful (lock was acquired). + * * Realtime safe? */ - inline int try_wait() { return sem_trywait(&_sem); } + inline bool try_wait() { return (sem_trywait(&_sem) == 0); } private: sem_t _sem; |