diff options
Diffstat (limited to 'dep/include/zthread/Thread.h')
-rw-r--r-- | dep/include/zthread/Thread.h | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/dep/include/zthread/Thread.h b/dep/include/zthread/Thread.h index e1700c737fa..23ecd1af4bf 100644 --- a/dep/include/zthread/Thread.h +++ b/dep/include/zthread/Thread.h @@ -30,9 +30,9 @@ #include "zthread/Waitable.h" namespace ZThread { - + class ThreadImpl; - + /** * @class Thread * @author Eric Crahen <http://www.code-foo.com> @@ -50,8 +50,8 @@ namespace ZThread { * * <h2><a name="ex1">Launching a task</a></h2> * - * A thread is started simply by constructing a thread object and giving - * it a task to perform. The thread will continue to run its task, even + * A thread is started simply by constructing a thread object and giving + * it a task to perform. The thread will continue to run its task, even * after the Thread object used to launch the thread has gone out of scope. * * @code @@ -74,12 +74,12 @@ namespace ZThread { * int main() { * * try { - * + * * // Implictly constructs a Task * Thread t(new aRunnable); * - * } catch(Synchronization_Exception& e) { - * std::cerr << e.what() << std::endl; + * } catch(Synchronization_Exception& e) { + * std::cerr << e.what() << std::endl; * } * * std::cout << "Hello from the main thread" << std::endl; @@ -121,13 +121,13 @@ namespace ZThread { * int main() { * * try { - * + * * // Implictly constructs a Task * Thread t(new aRunnable); * t.wait(); * - * } catch(Synchronization_Exception& e) { - * std::cerr << e.what() << std::endl; + * } catch(Synchronization_Exception& e) { + * std::cerr << e.what() << std::endl; * } * * std::cout << "Hello from the main thread" << std::endl; @@ -169,7 +169,7 @@ namespace ZThread { * int main() { * * try { - * + * * // Explictly constructs a Task * Task task(new aRunnable); * @@ -177,8 +177,8 @@ namespace ZThread { * Thread t1(task); * Thread t2(task); * - * } catch(Synchronization_Exception& e) { - * std::cerr << e.what() << std::endl; + * } catch(Synchronization_Exception& e) { + * std::cerr << e.what() << std::endl; * } * * std::cout << "Hello from the main thread" << std::endl; @@ -195,7 +195,7 @@ namespace ZThread { * * @endcode */ - class ZTHREAD_API Thread + class ZTHREAD_API Thread : public Cancelable, public Waitable, public NonCopyable { //! Delegate @@ -212,7 +212,7 @@ namespace ZThread { /** * Create a Thread that spawns a new thread to run the given task. * - * @param task Task to be run by a thread managed by this executor + * @param task Task to be run by a thread managed by this executor * @param autoCancel flag to requestion automatic cancellation * * @post if the <i>autoCancel</i> flag was true, this thread will @@ -241,17 +241,17 @@ namespace ZThread { * @exception Interrupted_Exception thrown if the joining thread has been interrupt()ed */ void wait(); - + /** * Wait for the thread represented by this object to complete its task. * The calling thread is blocked until the thread represented by this * object exits, or until the timeout expires. * - * @param timeout maximum amount of time (milliseconds) this method + * @param timeout maximum amount of time (milliseconds) this method * could block the calling thread. * - * @return - * - <em>true</em> if the thread task complete before <i>timeout</i> + * @return + * - <em>true</em> if the thread task complete before <i>timeout</i> * milliseconds elapse. * - <em>false</em> othewise. * @@ -260,10 +260,10 @@ namespace ZThread { * @exception Interrupted_Exception thrown if the joining thread has been interrupt()ed */ bool wait(unsigned long timeout); - + /** * Change the priority of this Thread. This will change the actual - * priority of the thread when the OS supports it. + * priority of the thread when the OS supports it. * * If there is no real priority support, it's simulated. * @@ -280,18 +280,18 @@ namespace ZThread { /** * Interrupts this thread, setting the <i>interrupted</i> status of the thread. - * This status is cleared by one of three methods. + * This status is cleared by one of three methods. * * If this thread is blocked when this method is called, the thread will * abort that blocking operation with an Interrupted_Exception. * * - The first is by attempting an operation on a synchronization object that - * would normally block the calling thread; Instead of blocking the calling + * would normally block the calling thread; Instead of blocking the calling * the calling thread, the function that would normally block will thrown an * Interrupted_Exception and clear the <i>interrupted</i> status of the thread. * * - The second is by calling Thread::interrupted(). - * + * * - The third is by calling Thread::canceled(). * * Threads already blocked by an operation on a synchronization object will abort @@ -300,7 +300,7 @@ namespace ZThread { * * Interrupting a thread that is no longer running will have no effect. * - * @return + * @return * - <em>true</em> if the thread was interrupted while not blocked by a wait * on a synchronization object. * - <em>false</em> othewise. @@ -311,11 +311,11 @@ namespace ZThread { * Tests whether the current Thread has been interrupt()ed, clearing * its interruption status. * - * @return + * @return * - <em>true</em> if the Thread was interrupted. * - <em>false</em> otherwise. * - * @post The <i>interrupted</i> status of the current thread will be cleared, + * @post The <i>interrupted</i> status of the current thread will be cleared, * allowing it to perform a blocking operation on a synchronization * object without throwing an exception. */ @@ -333,16 +333,16 @@ namespace ZThread { * Tests whether this thread has been canceled. If called from the context * of this thread, the interrupted status is cleared. * - * @return + * @return * - <em>true</em> if the Thread was canceled. * - <em>false</em> otherwise. - * + * * @see Cancelable::isCanceled() */ virtual bool isCanceled(); /** - * Interrupt and cancel this thread in a single operation. The thread will + * Interrupt and cancel this thread in a single operation. The thread will * return <em>true</em> whenever its cancelation status is tested in the future. * * @exception InvalidOp_Exception thrown if a thread attempts to cancel itself |