1 #if !defined(__THREADCONTEXT_HPP)
2 #define __THREADCONTEXT_HPP
24 #if !defined(__COMMON_HPP)
28 #if !defined(__THREADEXCEPTION_HPP)
29 #include <ThreadException.hpp>
70 DECLARE_CLASS( ThreadContext );
221 bool operator==( ThreadIdentifierCref )
const;
235 operator ThreadIdentifierCref(
void )
const;
501 static void defaultStackDestroy( BytePtr );
560 ThreadIdentifier theThreadIdentifier;
577 #endif // if !defined(__THREADCONTEXT_HPP)
The thread is running.
Definition: ThreadContext.hpp:49
ThreadException is the base exception type for Thread.
Definition: ThreadException.hpp:39
Int getShareMask(void) const
Get the share mask for the thread which determines VM, FILES, FILESYSTEM, SIGNAL shares.
Definition: ThreadContext.cpp:332
static Int cloneFrameFunction(ThreadContextPtr)
The definitive thread frame entry point.
Definition: ThreadContext.cpp:519
ThreadIdentifierCref getIdentifier(void) const
Get the identifier for the thread.
Definition: ThreadContext.cpp:311
Thread never started.
Definition: ThreadContext.hpp:65
The thread is waiting to be started.
Definition: ThreadContext.hpp:41
CallerFunctionPtr getCallerFunction(void)
Return the function pointer of the callers thread routine.
Definition: ThreadContext.cpp:318
ThreadContextPtr(* ThreadContextCreatePtr)(ThreadContextRef)
Managed ThreadContext creation function.
Definition: ThreadContext.hpp:97
void setReturnCode(Int)
Set the return code for the thread.
Definition: ThreadContext.cpp:373
Int(* ThreadFrameFunctionPtr)(ThreadContextPtr)
Thread frame entry point function handler.
Definition: ThreadContext.hpp:86
ThreadContext describes the context in which the thread operates.
Definition: ThreadContext.hpp:137
void(* ThreadContextDestroyPtr)(ThreadContextPtr)
Managed ThreadContext deallocate function.
Definition: ThreadContext.hpp:108
BytePtr * getStackTop(void)
Get the top of stack pointer.
Definition: ThreadContext.cpp:346
int(* CallerFunctionPtr)(ThreadContextPtr)
Callers function entry point.
Definition: ThreadContext.hpp:78
void setContextFunctions(ThreadContextCreatePtr, ThreadContextDestroyPtr)
Allows the caller to substitute the routines which create and destroy the managed ThreadContext objec...
Definition: ThreadContext.cpp:407
ThreadContext(void)
Default constructor throws NEVER_GET_HERE.
Definition: ThreadContext.cpp:81
ThreadState
Thread state enumeration.
Definition: ThreadContext.hpp:37
void setShareMask(Int)
Change the sharing mask for the thread.
Definition: ThreadContext.cpp:359
ThreadContextRef operator=(ThreadContextCref)
Assignment operator changes the context.
Definition: ThreadContext.cpp:238
Thread never started with exception.
Definition: ThreadContext.hpp:57
virtual ThreadFrameFunctionPtr getFramePointer(void)
Get the thread frame function pointer.
Definition: ThreadContext.cpp:352
bool operator==(ThreadContextCref) const
Equality operator compares contexts.
Definition: ThreadContext.cpp:269
Thread completed without exception.
Definition: ThreadContext.hpp:53
BytePtr getStack(void)
Get the stack pointer.
Definition: ThreadContext.cpp:339
void destroyContext(ThreadContextPtr)
Destroys the context instance.
Definition: ThreadContext.cpp:500
Size getStackSize(void) const
Get the size of the stack as defined by the context constructor.
Definition: ThreadContext.cpp:325
void setThreadState(ThreadState)
Set the state for the thread.
Definition: ThreadContext.cpp:366
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
ThreadContextPtr createContext(void)
Create a instance of ourself, we also invoke the create stack method so the instance is ready to be u...
Definition: ThreadContext.cpp:460
const ThreadState & getState(void) const
Get the state of the thread as reflected in its context.
Definition: ThreadContext.cpp:297
void setFrameFunction(ThreadFrameFunctionPtr)
Allows the caller to substitute the thread frame entry point.
Definition: ThreadContext.cpp:380
BytePtr(* ThreadStackCreatePtr)(ThreadContextPtr)
Managed ThreadContext stack creation function.
Definition: ThreadContext.hpp:118
Thread has died with exception.
Definition: ThreadContext.hpp:61
virtual ~ThreadContext(void)
Virtual destructor.
Definition: ThreadContext.cpp:216
void(* ThreadStackDestroyPtr)(BytePtr)
Managed ThreadContext stack deallocate function.
Definition: ThreadContext.hpp:129
The thread is in the process of starting.
Definition: ThreadContext.hpp:45
void setStackFunctions(ThreadStackCreatePtr, ThreadStackDestroyPtr)
Allows the caller to substitute the routines which create and destroy the managed ThreadContext stack...
Definition: ThreadContext.cpp:434
Int getReturnCode(void) const
Return the code returned by the callers function.
Definition: ThreadContext.cpp:304