#include <thread.h>
Collaboration diagram for ThreadKernel:
Public Member Functions | |
~ThreadKernel () | |
Static Public Member Functions | |
void | init () |
Initialize the thread kernel. | |
void | cleanup () |
Cleanup thread kernel. | |
int | NRunningThreads () |
Ask the kernel about the number of threads currently running. | |
Private Member Functions | |
void | _PhookNotifier (gpointer ptr) |
void * | _ThreadFuncWrapper (void *ptr) |
void | _unregister (ExecutionThread *et) |
int | _NRunningThreads () |
ThreadKernel (const ThreadKernel &) | |
Never call these:. | |
void | operator= (const ThreadKernel &) |
ThreadKernel () | |
Static Private Member Functions | |
void | unregister (ExecutionThread *et) |
void | PhookNotifier (gpointer ptr) |
void * | ThreadFuncWrapper (void *ptr) |
Private Attributes | |
GPrivate * | phook |
This is used to get informed about thread exits. | |
RecursiveMutex | mutex |
Protect internal data structures. | |
LinkedList< TNode > | threadlist |
The thread kernel holds a list of all running threads. | |
int | nrunning |
Count number of elements in the list:. | |
Static Private Attributes | |
ThreadKernel * | kernel = NULL |
There exists exactly one instance of the thread kernel. | |
Friends | |
class | ExecutionThread |
Definition at line 49 of file thread.h.
|
Never call these:.
|
|
NEver create an object of type ThreadKernel. Only use the static members. Definition at line 162 of file thread.cc. References Assert, CritAssert, kernel, RecursiveMutex::lock(), mutex, phook, PhookNotifier(), and RecursiveMutex::unlock(). Referenced by init(). |
|
Definition at line 188 of file thread.cc. References Assert, CritAssert, LinkedList< TNode >::IsEmpty(), kernel, RecursiveMutex::lock(), mutex, nrunning, phook, LinkedList< TNode >::PopFirst(), threadlist, and RecursiveMutex::unlock(). |
|
Definition at line 24 of file thread.cc. References RecursiveMutex::lock(), mutex, nrunning, and RecursiveMutex::unlock(). Referenced by NRunningThreads(). |
|
Definition at line 73 of file thread.cc. References CritAssert, LinkedList< TNode >::dequeue(), ThreadKernel::TNode::execthread, ExecutionThread::handle, RecursiveMutex::lock(), mutex, nrunning, ThreadKernel::TNode::thread, threadlist, and RecursiveMutex::unlock(). Referenced by PhookNotifier(). |
|
Definition at line 34 of file thread.cc. References LinkedList< TNode >::append(), CritAssert, ThreadKernel::TNode::execthread, ExecutionThread::handle, RecursiveMutex::lock(), mutex, nrunning, phook, ExecutionThread::run(), ThreadKernel::TNode::thread, threadlist, and RecursiveMutex::unlock(). Referenced by ThreadFuncWrapper(). |
|
For internal use only. From static functions, "forwarded": Definition at line 126 of file thread.cc. References ThreadKernel::TNode::execthread, ExecutionThread::handle, kernel, RecursiveMutex::lock(), mutex, and RecursiveMutex::unlock(). Referenced by unregister(). |
|
Cleanup thread kernel. This can be used to clean up the thread kernel before exiting in order to get allocation debugging happy :)
Definition at line 155 of file thread.cc. References kernel. |
|
Initialize the thread kernel. This must be done before starting any threads. Definition at line 149 of file thread.cc. References ThreadKernel(). |
|
Ask the kernel about the number of threads currently running.
Definition at line 130 of file thread.h. References _NRunningThreads(), and kernel. |
|
|
|
For internal use only. Used as callback by phook. Definition at line 119 of file thread.cc. References _PhookNotifier(), and kernel. Referenced by ThreadKernel(). |
|
For internal use only. Used as wrapper to start threads. Definition at line 66 of file thread.cc. References _ThreadFuncWrapper(), and kernel. |
|
Internally used by ExecutionThread to unregister when destroyed although there is still a handle attached. Definition at line 69 of file thread.h. References _unregister(), and kernel. Referenced by ExecutionThread::~ExecutionThread(). |
|
|
|
There exists exactly one instance of the thread kernel.
Definition at line 21 of file thread.cc. Referenced by _unregister(), cleanup(), NRunningThreads(), PhookNotifier(), ThreadFuncWrapper(), ThreadKernel(), unregister(), and ~ThreadKernel(). |
|
Protect internal data structures.
Definition at line 76 of file thread.h. Referenced by _NRunningThreads(), _PhookNotifier(), _ThreadFuncWrapper(), _unregister(), ThreadKernel(), and ~ThreadKernel(). |
|
Count number of elements in the list:.
Definition at line 81 of file thread.h. Referenced by _NRunningThreads(), _PhookNotifier(), _ThreadFuncWrapper(), and ~ThreadKernel(). |
|
This is used to get informed about thread exits.
Definition at line 73 of file thread.h. Referenced by _ThreadFuncWrapper(), ThreadKernel(), and ~ThreadKernel(). |
|
The thread kernel holds a list of all running threads.
Definition at line 79 of file thread.h. Referenced by _PhookNotifier(), _ThreadFuncWrapper(), and ~ThreadKernel(). |