IThread



Describes platform thread.

You can find more information in comments below.

// Pause(), Resume(), and thread priority is optional features and may not be supported by all platforms 
class IThread
{
public:
    enum THREAD_PRIORITY // Thread priorities 
    {
        tpIdle, // Idle 
        tpLowest, // Lowest 
        tpLow, // Below normal 
        tpNormal, // Normal 
        tpHigh, // Above normal 
        tpHighest, // Highest 
        tpTimeCritical // Time critical 
    };
public:
    virtual bool isCreated() = 0; // Return whether thread was created successfully or it failed and cannot be used 
    virtual bool isTerminated() = 0; // Return whether thread should terminate its job. Listener should check this property and cancel a job 
    virtual bool isPaused() = 0; // Return whether thread is paused or active 
    virtual THREAD_PRIORITY getPriority() = 0; // Return thread priority 
    virtual IThreadListener *getListener() = 0; // Return associated listener 

    virtual bool setPriority(const THREAD_PRIORITY value) = 0; // Set thread priority 

    virtual void Release() = 0; // Delete itself. Should be called only after job completion(or successful termination) 
    virtual bool Terminate() = 0; // Terminate execution. Usually some time will ellapse before thread stops 
    virtual bool Pause() = 0; // Pause the thread 
    virtual bool Resume() = 0; // Resume paused thread 
    virtual bool Wait(const float interval) = 0; // Wait until thread finish its job but no longer than specified interval 
};
Namespace: nitisa
Include: Nitisa/Interfaces/IThread.h