1 #if !defined(__THREAD_HPP)
24 #if !defined IN_COMMON_HPP
25 #error Thread.hpp is included by Common.hpp only.
28 #if !defined(__SINGLETON_HPP)
29 #include <Singleton.hpp>
32 #if !defined(__MAP_HPP)
36 #if !defined(__INVALIDTHREADEXCEPTION_HPP)
37 #include <InvalidThreadException.hpp>
42 DECLARE_CLASS( ThreadContext );
48 std::less<ThreadIdentifier>,
56 DECLARE_CLASS( Thread );
57 DECLARE_TYPE( Singleton<Thread>, ThreadManager );
172 static void dump(
void );
279 static void threadTerminated( Int, VoidPtr, VoidPtr );
291 static ThreadMap theThreadMap;
293 static ThreadIdentifier theThreadManagerId;
294 static Count theThreadCount;
299 #endif // if !defined(__THREAD_HPP)
static ThreadIdentifier startThread(ThreadContextRef)
Start a thread as described by the context.
Definition: Thread.cpp:302
virtual ~Thread(void)
Virtual destructor.
Definition: Thread.cpp:101
static ThreadContextCref getThreadContext(ThreadIdentifierCref)
Retrieve a ThreadContext given a identifier.
Definition: Thread.cpp:152
static ThreadIdentifierCref getThreadManagerIdentifier(void)
getThreadManagerIdentifier retrieves the thread that Thread was instantiated from ...
Definition: Thread.cpp:145
static Count getCompletedThreadCount(void)
Retrieve the number of threads that are not starting or running or waiting to run.
Definition: Thread.cpp:215
static Count getCreatedThreadCount(void)
Retrieve the number of created threads.
Definition: Thread.cpp:171
static ThreadManager theThreadManager
The singleton instance of Thread for synchronization.
Definition: Thread.hpp:285
ThreadContext describes the context in which the thread operates.
Definition: ThreadContext.hpp:137
static void dump(void)
Debugging method for the moment.
Definition: Thread.cpp:283
static Int waitForThread(ThreadIdentifierCref)
Blocks the caller until the thread has ended execution, retrieving the return code from the associate...
Definition: Thread.cpp:375
InvalidThreadException describes an exception that is thrown when a operation is attempted on a non-m...
Definition: InvalidThreadException.hpp:43
ThreadRef operator=(ThreadCref)
Assignment operator won't do, we should never get here anyway but the compiler will generate the miss...
Definition: Thread.cpp:108
Ensure a class only has one instance, and provide a global point of access to it. ...
Definition: Singleton.hpp:38
static Count getBlockedThreadCount(void)
Retrieve the number of threads that are waiting ro tun.
Definition: Thread.cpp:249
static ThreadIdentifier getThreadIdentifier(void)
getThreadIdentifier retrieves the kernel process id for the caller thread
Definition: Thread.cpp:131
static Int getKernelError(void)
getKernelError returns the thread instance errno for the last kernel call the thread made ...
Definition: Thread.cpp:124
Thread(void)
Default constructor.
Definition: Thread.cpp:58
static void setThreadPriority(ThreadIdentifierCref, Int)
Set thread priority for the given indentifier.
Definition: Thread.cpp:438
static ThreadIdentifier getParentThreadIdentifier(void)
getParentThreadIdentifier retrieves the parent thread of the current thread.
Definition: Thread.cpp:138
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
ScalarIdentifier provides a templated interface for declaring CoreLinux Identifiers for simple scalar...
Definition: ScalarIdentifiers.hpp:37
bool operator==(ThreadCref) const
Equality operator not valid for class utility.
Definition: Thread.cpp:116
static Count getActiveThreadCount(void)
Retrieve the number of threads that are starting or running.
Definition: Thread.cpp:178
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
Synchronized is a mixin which allows class objects to enable monitor functionality.
Definition: Synchronized.hpp:41
static Int getThreadPriority(ThreadIdentifierCref)
Get thread priority for the given indentifier.
Definition: Thread.cpp:429
static void destroyThreadContext(ThreadIdentifierCref)
Destroys the managed context for the given identifier.
Definition: Thread.cpp:387
Thread is a framework for the creation, management, and destruction of caller threads.
Definition: Thread.hpp:73