diff options
author | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
commit | 6aee5fcbe7473a3cbac12b7e8482a7b98bef8be3 (patch) | |
tree | 91ec91d5c19eba9c2fe0e84b1c9dc7047a3de80e /dep/include/zthread/CountingSemaphore.h | |
parent | 2d2f433b4de1c35b22aaf07854fc0ee11fcb350d (diff) | |
parent | f385747164c3fb278c92ef46fbd6c3da6590bbf0 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'dep/include/zthread/CountingSemaphore.h')
-rw-r--r-- | dep/include/zthread/CountingSemaphore.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/dep/include/zthread/CountingSemaphore.h b/dep/include/zthread/CountingSemaphore.h index f580a65f726..ea23300c2a7 100644 --- a/dep/include/zthread/CountingSemaphore.h +++ b/dep/include/zthread/CountingSemaphore.h @@ -27,17 +27,17 @@ #include "zthread/NonCopyable.h" namespace ZThread { - + class FifoSemaphoreImpl; - + /** * @class CountingSemaphore * @author Eric Crahen <http://www.code-foo.com> * @date <2003-07-16T15:26:18-0400> * @version 2.2.1 * - * A CountingSemaphore is an owner-less Lockable object. - * + * A CountingSemaphore is an owner-less Lockable object. + * * It differs from a normal Semaphore in that there is no upper bound on the count * and it will not throw an exception because a maximum value has been exceeded. * @@ -46,17 +46,17 @@ namespace ZThread { * Threads blocked on a CountingSemaphore are resumed in FIFO order. */ class ZTHREAD_API CountingSemaphore : public Lockable, private NonCopyable { - - FifoSemaphoreImpl* _impl; + + FifoSemaphoreImpl* _impl; public: /** - * Create a new CountingSemaphore. + * Create a new CountingSemaphore. * * @param count - initial count */ - CountingSemaphore(int initialCount = 0); + CountingSemaphore(int initialCount = 0); //! Destroy the CountingSemaphore virtual ~CountingSemaphore(); @@ -65,8 +65,8 @@ namespace ZThread { * <i>Provided to reflect the traditional Semaphore semantics</i> * * @see acquire() - */ - void wait(); + */ + void wait(); /** @@ -74,51 +74,51 @@ namespace ZThread { * * @see tryAcquire(unsigned long timeout) */ - bool tryWait(unsigned long timeout); + bool tryWait(unsigned long timeout); /** * <i>Provided to reflect the traditional Semaphore semantics</i> * * @see release() */ - void post(); + void post(); + - /** - * Get the current count of the semaphore. + * Get the current count of the semaphore. * * This value may change immediately after this function returns to the calling thread. * * @return <em>int</em> count */ - virtual int count(); - + virtual int count(); + /** - * Decrement the count, blocking that calling thread if the count becomes 0 or - * less than 0. The calling thread will remain blocked until the count is + * Decrement the count, blocking that calling thread if the count becomes 0 or + * less than 0. The calling thread will remain blocked until the count is * raised above 0, an exception is thrown or the given amount of time expires. - * + * * @param timeout maximum amount of time (milliseconds) this method could block - * - * @return + * + * @return * - <em>true</em> if the Semaphore was acquired before <i>timeout</i> milliseconds elapse. * - <em>false</em> otherwise. * * @exception Interrupted_Exception thrown when the calling thread is interrupted. * A thread may be interrupted at any time, prematurely ending any wait. - * + * * @see Lockable::tryAcquire(unsigned long timeout) */ virtual bool tryAcquire(unsigned long timeout); /** - * Decrement the count, blocking that calling thread if the count becomes 0 or - * less than 0. The calling thread will remain blocked until the count is + * Decrement the count, blocking that calling thread if the count becomes 0 or + * less than 0. The calling thread will remain blocked until the count is * raised above 0 or if an exception is thrown. - * + * * @exception Interrupted_Exception thrown when the calling thread is interrupted. * A thread may be interrupted at any time, prematurely ending any wait. - * + * * @see Lockable::acquire() */ virtual void acquire(); @@ -129,8 +129,8 @@ namespace ZThread { * @see Lockable::release() */ virtual void release(); - - }; + + }; } // namespace ZThread |