mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Refactor thread utility interface
- Add "thr_" prefix to thread utility functions - Compare threadid_ts in a portable manner, where possible
This commit is contained in:
@@ -241,7 +241,7 @@ public:
|
||||
{
|
||||
|
||||
#ifndef SERVER
|
||||
m_main_thread = get_current_thread_id();
|
||||
m_main_thread = thr_get_current_thread_id();
|
||||
#endif
|
||||
clear();
|
||||
}
|
||||
@@ -317,7 +317,7 @@ public:
|
||||
<<name<<"\""<<std::endl;
|
||||
|
||||
// This is not thread-safe
|
||||
sanity_check(get_current_thread_id() == m_main_thread);
|
||||
sanity_check(thr_is_current_thread(m_main_thread));
|
||||
|
||||
// Skip if already in cache
|
||||
ClientCached *cc = NULL;
|
||||
@@ -448,7 +448,7 @@ public:
|
||||
if(cc)
|
||||
return cc;
|
||||
|
||||
if(get_current_thread_id() == m_main_thread)
|
||||
if(thr_is_current_thread(m_main_thread))
|
||||
{
|
||||
return createClientCachedDirect(name, gamedef);
|
||||
}
|
||||
|
Reference in New Issue
Block a user