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

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)
 
virtual void interrupt ()=0
 
virtual void execute (const Task &task)=0
 
- Public Member Functions inherited from Cancelable
virtual ~Cancelable ()
 Destroy a Cancelable object.
 
virtual void cancel ()=0
 
virtual bool isCanceled ()=0
 
- Public Member Functions inherited from Waitable
virtual ~Waitable ()
 Destroy a Waitable object.

 
virtual void wait ()=0
 
virtual bool wait (unsigned long timeout)=0
 

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

◆ cancel()

virtual void cancel ( )
virtual
See also
Cancelable::cancel()

Implements Cancelable.

◆ execute()

virtual void execute ( const Task task)
virtual

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

Parameters
taskTask 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_Exceptionthrown if the Executor was canceled prior to the invocation of this function.
See also
Executor::execute(const Task& task)

Implements Executor.

◆ interrupt()

virtual void interrupt ( )
virtual

This operation is not supported by this executor.

Implements Executor.

◆ isCanceled()

virtual bool isCanceled ( )
virtual
See also
Cancelable::cancel()

Implements Cancelable.

◆ wait() [1/2]

virtual void wait ( )
virtual

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

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

Implements Waitable.

◆ wait() [2/2]

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_Exceptionthrown 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.


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