mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
thread local refactoring
This commit is contained in:
@@ -39,6 +39,9 @@
|
||||
namespace NK2AI
|
||||
{
|
||||
|
||||
// one thread may be turn of AI and another will be handling a side effect for AI2
|
||||
thread_local CCallback * ccTl = nullptr;
|
||||
thread_local AIGateway * aiGwTl = nullptr;
|
||||
#define NET_EVENT_HANDLER SET_GLOBAL_STATE(this)
|
||||
|
||||
AIGateway::AIGateway()
|
||||
|
||||
@@ -28,9 +28,8 @@ VCMI_LIB_NAMESPACE_END
|
||||
namespace NK2AI
|
||||
{
|
||||
|
||||
// one thread may be turn of AI and another will be handling a side effect for AI2
|
||||
inline thread_local CCallback * ccTl = nullptr;
|
||||
inline thread_local AIGateway * aiGwTl = nullptr;
|
||||
extern thread_local CCallback * ccTl;
|
||||
extern thread_local AIGateway * aiGwTl;
|
||||
|
||||
// helper RAII to manage global ai/cb ptrs
|
||||
struct SetGlobalState
|
||||
|
||||
Reference in New Issue
Block a user