From 8f5f3f43c208528869c96caffb009e8d642299b5 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Fri, 14 Jul 2023 22:47:22 +0800 Subject: [PATCH] ... --- include/pocketpy/common.h | 6 +++--- src/vm.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/pocketpy/common.h b/include/pocketpy/common.h index 87261858..eca94256 100644 --- a/include/pocketpy/common.h +++ b/include/pocketpy/common.h @@ -40,7 +40,7 @@ /*******************************************************************************/ #if PK_ENABLE_THREAD -#define THREAD_LOCAL thread_local +#define PK_THREAD_LOCAL thread_local #include struct GIL { @@ -48,10 +48,10 @@ struct GIL { explicit GIL() { _mutex.lock(); } ~GIL() { _mutex.unlock(); } }; -#define PK_GLOBAL_SCOPE_LOCK() auto _lock = GIL(); +#define PK_GLOBAL_SCOPE_LOCK() GIL _lock(); #else -#define THREAD_LOCAL +#define PK_THREAD_LOCAL #define PK_GLOBAL_SCOPE_LOCK() #endif diff --git a/src/vm.cpp b/src/vm.cpp index d2c3fea3..0da52fcd 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -742,7 +742,7 @@ PyObject* VM::vectorcall(int ARGC, int KWARGC, bool op_call){ ArgsView args(p1 - ARGC - int(method_call), p1); ArgsView kwargs(p1, s_data._sp); - static THREAD_LOCAL PyObject* buffer[PK_MAX_CO_VARNAMES]; + static PK_THREAD_LOCAL PyObject* buffer[PK_MAX_CO_VARNAMES]; if(is_non_tagged_type(callable, tp_native_func)){ const auto& f = PK_OBJ_GET(NativeFunc, callable);