]> git.lizzy.rs Git - dragonfireclient.git/commit
Fix synchronization issue at thread start
authorsfan5 <sfan5@live.de>
Sat, 30 Apr 2022 14:04:19 +0000 (16:04 +0200)
committersfan5 <sfan5@live.de>
Mon, 2 May 2022 18:54:55 +0000 (20:54 +0200)
commit663c9364289dae45aeb86a87cba826f577d84a9c
treeeecbde60c46f941a7185cff4e88bef2bd5768e11
parent56a558baf8ef43810014347ae624cb4ef70b6aa3
Fix synchronization issue at thread start

If a newly started thread immediately exits then m_running would
immediately be set to false again and the caller would be stuck
waiting for m_running to become true forever.
Since a mutex for synchronizing startup already exists we can
simply move the while loop into it.

see also: #5134 which introduced m_start_finished_mutex
src/threading/thread.cpp