#include <ConcurrentExecutor.h>
- Author
- Eric Crahen http://www.code-foo.com
- Date
- <2003-07-16T22:36:11-0400>
- Version
- 2.3.0
A ConcurrentExecutor spawns a single thread to service a series of Tasks.
- See also
- PoolExecutor.
◆ cancel()
◆ execute()
virtual void execute |
( |
const Task & |
| ) |
|
|
virtual |
Submit a Task to this Executor. This will not block the current thread for very long. The task will be enqueued internally and eventually run in the context of the single thread driving all the Tasks submitted to this Executor.
- Exceptions
-
- See also
- Executor::execute(const Task&)
Implements Executor.
◆ interrupt()
virtual void interrupt |
( |
| ) |
|
|
virtual |
Interrupting a ConcurrentExecutor will cause the thread running the tasks to be be interrupted once during the execution of each task that has been submitted at the time this function is called.
Tasks that are submitted after this function is called will not be interrupt()ed; unless this function is invoked again().
void aFunction() {
for(size_t n = 0; n < p; n++)
executor.execute(new aRunnable);
executor.interrupt();
for(size_t n = p; n < q; n++)
executor.execute(new Chore);
}
ConcurrentExecutor()
Create a ConcurrentExecutor.
Implements Executor.
◆ isCanceled()
virtual bool isCanceled |
( |
| ) |
|
|
virtual |
◆ wait() [1/2]
◆ wait() [2/2]
virtual bool wait |
( |
unsigned long |
timeout | ) |
|
|
virtual |
The documentation for this class was generated from the following file: