Skip to content

Commit d45e5dc

Browse files
committed
fix(WindowUnix): Crashing on Linux when multithreading
1 parent e31eeb6 commit d45e5dc

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/Core/EngineThread.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
namespace sh::core
44
{
55
EngineThread::EngineThread(bool bSleepThread) :
6-
thr([&] { Update(); }),
76
mutex(mu),
87
mu(), cv(nullptr),
98
bStop(false),
10-
bSleep(bSleepThread)
9+
bSleep(bSleepThread),
10+
otherThreadTasks()
1111
{
12+
thr = std::thread{ [&] { Update(); } };
1213
}
1314

1415
auto EngineThread::GetThread() -> std::thread&

src/Window/Unix/WindowImplUnix.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ namespace sh::window {
2020
{
2121
std::cout << "WindowImplUnix::Create()\n";
2222

23+
XInitThreads();
24+
2325
//디스플레이 서버에 접속한다.
2426
display = XOpenDisplay(NULL);
2527

0 commit comments

Comments
 (0)