mirror of
https://github.com/ARMSX2/ARMSX3.git
synced 2026-08-24 16:58:52 -07:00
named_thread: fix bugs in std::forward usage
Fix few misused threads and other bugs.
This commit is contained in:
@@ -2211,8 +2211,16 @@ thread_state thread_ctrl::state()
|
||||
{
|
||||
auto _this = g_tls_this_thread;
|
||||
|
||||
// Guard for recursive calls (TODO: may be more effective to reuse one of m_sync bits)
|
||||
static thread_local bool s_tls_exec = false;
|
||||
|
||||
// Drain execution queue
|
||||
_this->exec();
|
||||
if (!s_tls_exec)
|
||||
{
|
||||
s_tls_exec = true;
|
||||
_this->exec();
|
||||
s_tls_exec = false;
|
||||
}
|
||||
|
||||
return static_cast<thread_state>(_this->m_sync & 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user