Skip to content

Commit

Permalink
Rename poorly-named variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quipyowert2 committed Jun 16, 2023
1 parent c8eeb02 commit dd57b9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Glob2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ int Glob2::run(int argc, char *argv[])
globalContainer->mainthr = std::this_thread::get_id();
globalContainer->mainthrSet = true;
if (!globalContainer->hostServer && !globalContainer->runNoX) {
globalContainer->otherthread = new std::thread(&Glob2::run, this, argc, argv);
globalContainer->logicThread = new std::thread(&Glob2::run, this, argc, argv);
}
}
if (!globalContainer->hostServer &&
Expand Down Expand Up @@ -447,8 +447,8 @@ int Glob2::run(int argc, char *argv[])
}
}

// quit event loop so otherthread can be joined by main thread
if (globalContainer->otherthread)
// quit event loop so logic thread can be joined by main thread
if (globalContainer->logicThread)
{
EventListener *el = EventListener::instance();
el->stop();
Expand Down
6 changes: 3 additions & 3 deletions src/GlobalContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ GlobalContainer::GlobalContainer(void)
replayShowFlags = true;

mainthrSet = false;
otherthread = nullptr;
logicThread = nullptr;

#ifndef YOG_SERVER_ONLY
replayReader = NULL;
Expand Down Expand Up @@ -522,8 +522,8 @@ void GlobalContainer::loadClient(bool runEventListener)
gfx->unsetContext();
el = new EventListener(gfx);
el->run();
otherthread->join();
delete otherthread;
logicThread->join();
delete logicThread;
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/GlobalContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ class GlobalContainer
bool replayShowAreas; //!< Show areas of gui.localPlayer or not. Can be edited real-time.
bool replayShowFlags; //!< Show all flags or show none. Can be edited real-time.

// other thread handles events in the queue, game logic, rendering, etc.
std::thread* otherthread;
// logic thread handles events in the queue, game logic, rendering, etc.
std::thread* logicThread;
// main thread listens for SDL events and adds them to a queue
std::thread::id mainthr;
std::atomic<bool> mainthrSet;
Expand Down

0 comments on commit dd57b9d

Please sign in to comment.