If you can read this text, it means you are not experiencing this website at its best. This website is designed for used with a standards-compliant browser.
Current version: 2.3.2
ZThreads
A platform-independent, multi-threading and synchronization library for C++
Home Documentation Downloads CVS Contact

SynchronousExecutor Class Reference

#include <SynchronousExecutor.h>

Inheritance diagram for SynchronousExecutor:

Executor Cancelable Waitable NonCopyable List of all members.

Public Member Functions

 SynchronousExecutor ()
 Create a new SynchronousExecutor.
virtual ~SynchronousExecutor ()
 Destroy a SynchronousExecutor.
virtual void interrupt ()
virtual void execute (const Task &task)
virtual void cancel ()
virtual bool isCanceled ()
virtual void wait ()
virtual bool wait (unsigned long timeout)

Detailed Description

Author:
Eric Crahen <http://www.code-foo.com>
Date:
<2003-07-16T22:33:51-0400>
Version:
2.3.0
A SynchronousExecutor is an Executor which runs tasks using the thread that submits the task. It runs tasks serially, one at a time, in the order they were submitted to the executor.

See also:
Executor.


Member Function Documentation

virtual void cancel  )  [virtual]
 

See also:
Cancelable::cancel()

Implements Cancelable.

virtual void execute const Task task  )  [virtual]
 

Submit a task to this Executor, blocking the calling thread until the task is executed.

Parameters:
task Task to be run by a thread managed by this executor
Precondition:
The Executor should have been canceled prior to this invocation.
Postcondition:
The submitted task will be run at some point in the future by this Executor.
Exceptions:
Cancellation_Exception thrown if the Executor was canceled prior to the invocation of this function.
See also:
Executor::execute(const Task& task)

Implements Executor.

virtual void interrupt  )  [virtual]
 

This operation is not supported by this executor.

Implements Executor.

virtual bool isCanceled  )  [virtual]
 

See also:
Cancelable::cancel()

Implements Cancelable.

virtual bool wait unsigned long  timeout  )  [virtual]
 

Block the calling thread until all tasks submitted prior to this invocation complete or until the calling thread is interrupted.

Parameters:
timeout - maximum amount of time, in milliseconds, to wait for the currently submitted set of Tasks to complete.
Exceptions:
Interrupted_Exception thrown if the calling thread is interrupted before the set of tasks being wait for can complete.
Returns:
  • true if the set of tasks being wait for complete before timeout milliseconds elapse.
  • false othewise.

Implements Waitable.

virtual void wait  )  [virtual]
 

Block the calling thread until all tasks submitted prior to this invocation complete.

Exceptions:
Interrupted_Exception thrown if the calling thread is interrupted before the set of tasks being wait for can complete.
See also:
Executor::wait()

Implements Waitable.


The documentation for this class was generated from the following file: