#include <process.h>
Collaboration diagram for process:
Public Types | |
typedef void(* | instructionPtr )(virtualMachine &, process &, thread &) |
typedef std::vector< instructionPtr > | instructionSet |
Public Member Functions | |
process (program &prog, uInt pid) | |
initialise active process | |
~process () | |
void | clean () |
terminates and cleans up the thread | |
program & | getProgram () |
get the program being run | |
processId | getId () |
get the id of the process | |
threadId | spawnThread (address addr) |
spawn a new thread at the specified address | |
void | killThread (threadId tid) |
kill the specified thread | |
uInt | getNumThreads () |
get the number of threads currently being executed | |
address | getThreadAddress (threadId tid) |
virtual bool | isTerminated () |
test if the process has terminated | |
Protected Member Functions | |
process () | |
initalise dead process | |
Protected Attributes | |
program * | m_pProgram |
pointer to the program being executed | |
uInt | m_threadCnt |
the number of active threads | |
processId | m_id |
the id of the process | |
Friends | |
class | std::vector< thread * > |
Definition at line 17 of file process.h.
|
|
|
|
|
initialise active process
|
|
Definition at line 17 of file process.cpp. References clean(). |
|
initalise dead process
Definition at line 122 of file process.cpp. |
|
terminates and cleans up the thread
Definition at line 23 of file process.cpp. References m_id, m_pProgram, and m_threadCnt. Referenced by virtualMachine::kill(), and ~process(). |
|
get the id of the process
Definition at line 47 of file process.cpp. |
|
get the number of threads currently being executed
Definition at line 93 of file process.cpp. References m_threadCnt, and uInt. |
|
get the program being run
Definition at line 40 of file process.cpp. References ASSERT, and m_pProgram. |
|
returns g_max_uInt if thread does not exist Definition at line 99 of file process.cpp. References address, getThreadAddress(), and thread::isTerminated(). Referenced by getThreadAddress(). |
|
test if the process has terminated
Definition at line 114 of file process.cpp. References m_pProgram, and m_threadCnt. Referenced by virtualMachine::canBeExecuted(). |
|
kill the specified thread
Definition at line 81 of file process.cpp. References killThread(), and m_threadCnt. Referenced by killThread(). |
|
spawn a new thread at the specified address
Definition at line 53 of file process.cpp. References address, m_threadCnt, spawnThread(), threadId, and uInt. Referenced by virtualMachine::run(), and spawnThread(). |
|
|
|
the id of the process
Definition at line 78 of file process.h. Referenced by clean(), getId(), virtualMachine::kill(), and virtualMachine::shouldBeTerminated(). |
|
pointer to the program being executed
Definition at line 72 of file process.h. Referenced by clean(), getProgram(), isTerminated(), and virtualMachine::run(). |
|
the number of active threads
Definition at line 75 of file process.h. Referenced by clean(), getNumThreads(), isTerminated(), killThread(), and spawnThread(). |