Vault
4.1
|
VForeignThread is a special case that is intended to be declared on the stack in a callback or similar function that is called by a foreign (non-VThread) source such as the Windows Service Control Manager. More...
#include <vthread.h>
Public Member Functions | |
VForeignThread (const VString &name) | |
virtual void | start () |
Starts the thread by creating whatever OS-specific resources are necessary, and invoking the thread main, resulting in the VThread subclass' run() method being called. | |
virtual void | run () |
Override required in each VThread subclass, run() does whatever the thread is designed to do, and returns when the thread has completed its task or detects that isRunning() returns false. |
VForeignThread is a special case that is intended to be declared on the stack in a callback or similar function that is called by a foreign (non-VThread) source such as the Windows Service Control Manager.
It allows you to give a name to that thread via the constructor, and it will register the current thread id with that name. This provides for getting a useful thread name (useful in VLogger output) from within that thread.
virtual void VForeignThread::run | ( | ) | [inline, virtual] |
Override required in each VThread subclass, run() does whatever the thread is designed to do, and returns when the thread has completed its task or detects that isRunning() returns false.
If the thread is designed to be stoppable from another thread, then its run() method must check the isRunning() property periodically and return when the property becomes false.
Implements VThread.