aboutsummaryrefslogtreecommitdiff
path: root/src/shm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/shm.cc')
-rw-r--r--src/shm.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/shm.cc b/src/shm.cc
index 7a63eae..98dd526 100644
--- a/src/shm.cc
+++ b/src/shm.cc
@@ -23,7 +23,8 @@ struct TSharedMemory {
int PrintBufferPosition;
char PrintBuffer[200][128];
GAMESTATE GameState;
- pid_t GameThreadPID;
+ pid_t GameProcessID;
+ pid_t GameThreadID;
};
static TSharedMemory *SHM = NULL;
@@ -101,10 +102,18 @@ bool GameEnding(void){
return Result;
}
-pid_t GetGameThreadPID(void){
+pid_t GetGameProcessID(void){
pid_t Pid = 0;
if(SHM != NULL){
- Pid = SHM->GameThreadPID;
+ Pid = SHM->GameProcessID;
+ }
+ return Pid;
+}
+
+pid_t GetGameThreadID(void){
+ pid_t Pid = 0;
+ if(SHM != NULL){
+ Pid = SHM->GameThreadID;
}
return Pid;
}
@@ -372,7 +381,8 @@ void InitSHM(bool Verbose){
SHM->PrintBufferPosition = 1;
SHM->GameState = GAME_STARTING;
- SHM->GameThreadPID = getpid();
+ SHM->GameProcessID = getpid();
+ SHM->GameThreadID = gettid();
}
void ExitSHM(void){