Thread interface. More...
#include <thread.h>

Public Types | |
|
typedef delegate1< thread_int &, void > | execute_handler |
| Entry point execute handler. | |
Public Member Functions | |
| virtual | ~thread_int () |
| Destructor. | |
| virtual void | start ()=0 |
| Start the thread execution. | |
| virtual void | stop ()=0 |
| Stop the thread execution. | |
| virtual void | pause ()=0 |
| Pause the thread execution. | |
| virtual void | resume ()=0 |
| Resume of the thread execution. | |
| virtual void | on_execute (execute_handler handler)=0 |
| Register the entry point execute handler. | |
| virtual void | wait_for ()=0 |
| Wait the thread for execution complete. | |
Thread interface.
This is an interface to the thread class. Any concrete thread class should subclass from this and implement pure virtual methods.
| virtual void dbp::thread_int::on_execute | ( | execute_handler | handler | ) | [pure virtual] |
Register the entry point execute handler.
You need to register your own thread execution handler. When the thread starts, your execution handler will be used as entry point of the thread, so this is a place to put your code to make the thread to do something useful.
See the 'examples/threads' directory for the sample code.
| handler | an execute handler delegate. |
Implemented in dbp::thread.