|
Base Module
VST 3.6.6
SDK for developing VST Plug-in
|
FThread wraps threads for each platform. More...
#include <fthread.h>
Public Member Functions | |
| FThread (const char8 *name="FThread") | |
| Thread constructor. More... | |
| virtual | ~FThread () |
| Destructor. More... | |
| void | run () |
| Starts the thread. More... | |
| void | terminate () |
| Terminates the thread. More... | |
| bool | isRunning () |
| Checks if thread is (still) running. More... | |
| bool | waitDead (int32 timeOut) |
| Waits for thread dead. More... | |
| virtual bool | setPriority (int32 priority) |
| Sets thread priority. More... | |
| int32 | getPriority () |
| Gets the current priority of this thread. More... | |
| virtual void | cleanup () |
| Override this method for any cleanup code. More... | |
| virtual uint32 | entry () |
| Override this method for the thread loop. More... | |
| const String & | getName () const |
| Gets the name of this thread. More... | |
| void * | getThreadReference () const |
| Gets the reference of this thread. More... | |
| bool | setCpuAffinity (int32 cpu) |
| Sets cpu affinity. More... | |
| bool | isInThreadContext () const |
| Check if current execution is in the thread context. More... | |
Static Public Member Functions | |
| static void | setSpy (IThreadSpy *spy) |
| Sets a thread spy which gets informed about new or removed threads. More... | |
Protected Attributes | |
| int32 | priority |
| Priority of thread. More... | |
| int32 | cpu |
| Cpu used by this thread. More... | |
| bool | running |
| Running state. More... | |
Static Protected Attributes | |
| static IThreadSpy * | gSpy |
| Global thread spy. More... | |
FThread wraps threads for each platform.
termination is best with waitDead and flags in the run loop....
| FThread | ( | const char8 * | name = "FThread" | ) |
Thread constructor.
| name | the name of the thread (can be seen in debugger) |
|
virtual |
Destructor.
| void run | ( | ) |
Starts the thread.
| void terminate | ( | ) |
Terminates the thread.
|
inline |
Checks if thread is (still) running.
| bool waitDead | ( | int32 | timeOut | ) |
Waits for thread dead.
This is the best to terminate this thread.
| timeOut | timeout in ms |
|
virtual |
Sets thread priority.
To boost priority a little bit permit a temporary raised task priority ....
Permit temporary raise of task priority.
| priority | thread priority, see FThreadPriority |
taskPriority defaults to static taskPriority if not set
|
inline |
Gets the current priority of this thread.
|
virtual |
Override this method for any cleanup code.
|
virtual |
Override this method for the thread loop.
|
inline |
Gets the name of this thread.
| void * getThreadReference | ( | ) | const |
Gets the reference of this thread.
| bool setCpuAffinity | ( | int32 | cpu | ) |
Sets cpu affinity.
Binds thread to a specific cpu.
| cpu | cpu id |
| bool isInThreadContext | ( | ) | const |
Check if current execution is in the thread context.
|
static |
Sets a thread spy which gets informed about new or removed threads.
There is only one spy allowed and it works without reference couting.
| spy | a thread spy |
|
protected |
Priority of thread.
|
protected |
Cpu used by this thread.
|
protected |
Running state.
|
staticprotected |
Global thread spy.