named_thread: fix bugs in std::forward usage

Fix few misused threads and other bugs.
This commit is contained in:
Nekotekina committed 2021-03-02 16:08:14 +03:00
1 parent d788b12a8e
commit bbf52f3cea
5 files changed
+111 -211

No files matched your search

+9 -1
View File
@@ -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);
}