mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00: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:
parent
836486a98e
commit
6be74d17df
6 changed files with 86 additions and 26 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue