A thread that keeps a list of clients, and calls each one in turn, giving them all a chance to run some sort of short task. More...
|TimeSliceThread (const String &threadName)|
|Creates a TimeSliceThread. |
|void||addTimeSliceClient (TimeSliceClient *client, int millisecondsBeforeStarting=0)|
|Adds a client to the list. |
|void||removeTimeSliceClient (TimeSliceClient *client)|
|Removes a client from the list. |
|void||moveToFrontOfQueue (TimeSliceClient *client)|
|If the given client is waiting in the queue, it will be moved to the front and given a time-slice as soon as possible. |
|int||getNumClients () const|
|Returns the number of registered clients. |
|TimeSliceClient *||getClient (int index) const|
|Returns one of the registered clients. |
|Public Member Functions inherited from Thread|
|Thread (const String &threadName)|
|Creates a thread. |
|virtual void||run ()=0|
|Must be implemented to perform the thread's actual code. |
|Starts the thread running. |
|void||startThread (int priority)|
|Starts the thread with a given priority. |
|void||stopThread (int timeOutMilliseconds)|
|Attempts to stop the thread running. |
|bool||isThreadRunning () const|
|Returns true if the thread is currently active. |
|Sets a flag to tell the thread it should stop. |
|bool||threadShouldExit () const|
|Checks whether the thread has been told to stop running. |
|bool||waitForThreadToExit (int timeOutMilliseconds) const|
|Waits for the thread to stop. |
|bool||setPriority (int priority)|
|Changes the thread's priority. |
|void||setAffinityMask (uint32 affinityMask)|
|Sets the affinity mask for the thread. |
|bool||wait (int timeOutMilliseconds) const|
|Makes the thread wait for a notification. |
|void||notify () const|
|Wakes up the thread. |
|ThreadID||getThreadId () const noexcept|
|Returns the ID of this thread. |
|const String &||getThreadName () const|
|Returns the name of the thread. |
|Public Types inherited from Thread|
|typedef void *||ThreadID|
|A value type used for thread IDs. |
|Static Public Member Functions inherited from Thread|
|static bool||setCurrentThreadPriority (int priority)|
|Changes the priority of the caller thread. |
|static void||setCurrentThreadAffinityMask (uint32 affinityMask)|
|Changes the affinity mask for the caller thread. |
|static void JUCE_CALLTYPE||sleep (int milliseconds)|
|static void JUCE_CALLTYPE||yield ()|
|Yields the calling thread's current time-slot. |
|static ThreadID||getCurrentThreadId ()|
|Returns an id that identifies the caller thread. |
|static Thread *||getCurrentThread ()|
|Finds the thread object that is currently running. |
|static void||setCurrentThreadName (const String &newThreadName)|
|Changes the name of the caller thread. |
A thread that keeps a list of clients, and calls each one in turn, giving them all a chance to run some sort of short task.
|void TimeSliceThread::addTimeSliceClient||(||TimeSliceClient *||client,|
Adds a client to the list.
The client's callbacks will start after the number of milliseconds specified by millisecondsBeforeStarting (and this may happen before this method has returned).
|void TimeSliceThread::removeTimeSliceClient||(||TimeSliceClient *||client||)|
Removes a client from the list.
This method will make sure that all callbacks to the client have completely finished before the method returns.
|void TimeSliceThread::moveToFrontOfQueue||(||TimeSliceClient *||client||)|
If the given client is waiting in the queue, it will be moved to the front and given a time-slice as soon as possible.
If the specified client has not been added, nothing will happen.
Returns the number of registered clients.
Returns one of the registered clients.