SysActivity Class Reference

#include <SysActivity.hpp>

Public Member Functions

 SysActivity ()
 
bool equals (thread_id_t t)
 
void create (RexxActivity *activity, size_t stackSize)
 
void close ()
 
void useCurrentThread ()
 
char * getStackBase (int32_t *base, size_t stackSize)
 
void setPriority (int p)
 
bool validateThread ()
 
thread_id_t getThreadID ()
 
 SysActivity ()
 
bool equals (thread_id_t t)
 
void create (RexxActivity *activity, size_t stackSize)
 
void close ()
 
void useCurrentThread ()
 
bool validateThread ()
 
char * getStackBase (int32_t *base, size_t stackSize)
 
thread_id_t getThreadID ()
 

Static Public Member Functions

static thread_id_t queryThreadID ()
 
static void yield ()
 
static wholenumber_t yieldCounter ()
 
static thread_id_t queryThreadID ()
 
static void yield ()
 
static wholenumber_t yieldCounter ()
 

Protected Attributes

pthread_t threadId
 
thread_id_t threadId
 
HANDLE hThread
 

Detailed Description

Definition at line 73 of file unix/SysActivity.hpp.

Constructor & Destructor Documentation

◆ SysActivity() [1/2]

SysActivity::SysActivity ( )
inline

Definition at line 76 of file unix/SysActivity.hpp.

◆ SysActivity() [2/2]

SysActivity::SysActivity ( )
inline

Definition at line 58 of file windows/SysActivity.hpp.

Member Function Documentation

◆ close() [1/2]

void SysActivity::close ( )

Close out any resources required by this thread descriptor.

Definition at line 69 of file unix/SysActivity.cpp.

References threadId.

Referenced by RexxActivity::cleanupActivityResources().

◆ close() [2/2]

void SysActivity::close ( )

◆ create() [1/2]

void SysActivity::create ( RexxActivity activity,
size_t  stackSize 
)

Create a new thread for an activity.

Parameters
activityThe activity that will run on this thread.
stackSizeThe desired stack size.

Create a real thread for the activity holding this item.

Parameters
activityThe activity we're creating on.
stackSizeThe required stack size.

Definition at line 80 of file unix/SysActivity.cpp.

References Error_System_service_service, reportException(), threadFnc(), and threadId.

Referenced by RexxActivity::RexxActivity().

◆ create() [2/2]

void SysActivity::create ( RexxActivity activity,
size_t  stackSize 
)

◆ equals() [1/2]

bool SysActivity::equals ( thread_id_t  t)
inline

Definition at line 77 of file unix/SysActivity.hpp.

References threadId.

Referenced by RexxActivity::isThread().

◆ equals() [2/2]

bool SysActivity::equals ( thread_id_t  t)
inline

Definition at line 59 of file windows/SysActivity.hpp.

References threadId.

◆ getStackBase() [1/2]

char * SysActivity::getStackBase ( int32_t base,
size_t  stackSize 
)

Return the pointer to the base of the current stack. This is used for checking recursion overflows.

Parameters
baseA local variable at the base of the stack.
stackSize
Returns
The character pointer for the stack base.

Definition at line 166 of file unix/SysActivity.cpp.

Referenced by RexxActivity::RexxActivity(), RexxActivity::run(), and RexxActivity::runThread().

◆ getStackBase() [2/2]

char* SysActivity::getStackBase ( int32_t base,
size_t  stackSize 
)

◆ getThreadID() [1/2]

thread_id_t SysActivity::getThreadID ( )
inline

Definition at line 84 of file unix/SysActivity.hpp.

References threadId.

Referenced by RexxActivity::threadIdMethod().

◆ getThreadID() [2/2]

thread_id_t SysActivity::getThreadID ( )
inline

Definition at line 65 of file windows/SysActivity.hpp.

References threadId.

◆ queryThreadID() [1/2]

thread_id_t SysActivity::queryThreadID ( )
static

Get the ID of the current thread.

Returns
The thread identifer for the current thread.

Definition at line 127 of file unix/SysActivity.cpp.

Referenced by ActivityManager::findActivity(), and InterpreterInstance::findActivity().

◆ queryThreadID() [2/2]

static thread_id_t SysActivity::queryThreadID ( )
static

◆ setPriority()

void SysActivity::setPriority ( int  p)

◆ useCurrentThread() [1/2]

void SysActivity::useCurrentThread ( )

Initialize the descriptor for manipulating the current active thread.

Definition at line 150 of file unix/SysActivity.cpp.

References threadId.

Referenced by RexxActivity::RexxActivity().

◆ useCurrentThread() [2/2]

void SysActivity::useCurrentThread ( )

◆ validateThread() [1/2]

bool SysActivity::validateThread ( )

Check if this activity is getting used on the correct thread.

Returns
true if the current thread is the same as the one the activity was created for.

Definition at line 140 of file unix/SysActivity.cpp.

References threadId.

Referenced by RexxActivity::validateThread().

◆ validateThread() [2/2]

bool SysActivity::validateThread ( )

◆ yield() [1/2]

void SysActivity::yield ( )
static

Definition at line 174 of file unix/SysActivity.cpp.

References yieldCount.

Referenced by ActivityManager::addWaitingActivity(), and RexxActivity::run().

◆ yield() [2/2]

static void SysActivity::yield ( )
static

◆ yieldCounter() [1/2]

wholenumber_t SysActivity::yieldCounter ( )
static

Definition at line 181 of file unix/SysActivity.cpp.

References yieldCount.

Referenced by ActivityManager::yieldCounter().

◆ yieldCounter() [2/2]

static wholenumber_t SysActivity::yieldCounter ( )
static

Member Data Documentation

◆ hThread

HANDLE SysActivity::hThread
protected

Definition at line 73 of file windows/SysActivity.hpp.

◆ threadId [1/2]

pthread_t SysActivity::threadId
protected

◆ threadId [2/2]

thread_id_t SysActivity::threadId
protected

Definition at line 72 of file windows/SysActivity.hpp.


The documentation for this class was generated from the following files: