#include <ThreadGroup.h>
Inheritance diagram for wkgl::ThreadGroup:

Public Methods | |
| ThreadGroup () | |
| Creates an unnamed thread group. | |
| ThreadGroup (char *name) | |
| Creates a new thread group with the given name. | |
| ~ThreadGroup (void) | |
| virtual void | addThread (Thread *t) |
| Adds a thread to the end of the list. | |
| virtual BOOL | start () |
| Calls start on all the threads in the group. | |
| virtual BOOL | stop () |
| Call stop on all the threads in the group. | |
| virtual BOOL | suspend () |
| Calls suspend on all the threads in the group. | |
| virtual BOOL | resume () |
| Calls resume on all the threads in the group. | |
| virtual BOOL | waitForCompletion (DWORD mill) |
| Stops the execution of the caller unitl the all the threads terminate. | |
| virtual BOOL | waitForCompletion () |
| Stops the execution of the caller unitl the all the threads terminate. | |
| virtual SFLAG | getState () |
| Returns the state of the group. | |
| virtual BOOL | start (void *param) |
| Executes the RUNNABLE function in a seperate thread. | |
| virtual char * | getName () |
| Returns the name of the thread. | |
Static Public Methods | |
| void | sleep (ULONG mill) |
| Causes the calling thread to stop execution for the given time. | |
| Thread * | getCurrentThread () |
| Returns the thread of the caller. | |
| void | wait (DWORD mill) |
| Causes the calling thread to stop executing until it is notifyed. | |
| void | wait () |
| Causes the calling thread to stop executing until it is notifyed. | |
| void | notify () |
| Notify a single waiting thread. | |
| void | notifyAll () |
| Notifies all waiting threads. | |
| void | yield () |
| Attempts to yeild the calling threads time slice to the next thread. | |
Protected Attributes | |
| std::vector< Thread * > | threads |
| A list of all the threads in the group. | |
| RUNNABLE | r |
| The function to run. | |
| SFLAG | state |
| The current state of the thread. | |
| DWORD | thread_id |
| The windows id of the thread. | |
| HANDLE | thandle |
| The windows handle to the thread. | |
| char * | name |
| The name of this thread. | |
| void * | param |
| The parameter to pass to r;. | |
Static Protected Attributes | |
| HANDLE | notify_event |
| This event is used in the wait/notify/notifyAll scheme. | |
| UINT | nwaiting = 0 |
| Counts the number of waiting threads. | |
Friends | |
| DWORD WINAPI | ThreadProc (LPVOID lpParam) |
| Used by win32 api. | |
|
|
Creates an unnamed thread group.
|
|
|
Creates a new thread group with the given name.
|
|
|
|
|
|
Adds a thread to the end of the list.
|
|
|
Returns the thread of the caller. So, Thread::getCurrentThread() != Thread::getCurrentThread().
|
|
|
Returns the name of the thread.
|
|
|
Returns the state of the group.
Reimplemented from wkgl::Thread. |
|
|
Notify a single waiting thread.
|
|
|
Notifies all waiting threads.
|
|
|
Calls resume on all the threads in the group.
Reimplemented from wkgl::Thread. |
|
|
Causes the calling thread to stop execution for the given time.
|
|
|
Executes the RUNNABLE function in a seperate thread.
|
|
|
Calls start on all the threads in the group.
Reimplemented from wkgl::Thread. |
|
|
Call stop on all the threads in the group.
Reimplemented from wkgl::Thread. |
|
|
Calls suspend on all the threads in the group.
Reimplemented from wkgl::Thread. |
|
|
Causes the calling thread to stop executing until it is notifyed.
|
|
|
Causes the calling thread to stop executing until it is notifyed.
|
|
|
Stops the execution of the caller unitl the all the threads terminate.
Reimplemented from wkgl::Thread. |
|
|
Stops the execution of the caller unitl the all the threads terminate.
Reimplemented from wkgl::Thread. |
|
|
Attempts to yeild the calling threads time slice to the next thread.
|
|
|
Used by win32 api.
|
|
|
The name of this thread.
|
|
|
Initial value: CreateEvent( NULL, TRUE, FALSE,
"MNThreadEvent" )
|
|
|
Counts the number of waiting threads.
|
|
|
The parameter to pass to r;.
|
|
|
The function to run.
|
|
|
The current state of the thread.
|
|
|
The windows handle to the thread.
|
|
|
The windows id of the thread.
|
|
|
A list of all the threads in the group.
|
1.2.18