File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,7 +106,9 @@ struct LuaScript
106106
107107#define ALE_STATE_PTR " ALE State Ptr"
108108#define LOCK_ALE ALE::Guard __guard (ALE::GetLock())
109- #define LOCK_ALE_STATE ALE::Guard __guard (this ->GetStateLock ())
109+ #define LOCK_ALE_STATE \
110+ ALE::Guard __ale_guard (ALEConfig::GetInstance().IsMultistateEnabled() ? ALE::GetNoopLock() : ALE::GetLock()); \
111+ Guard __ale_state_guard (this ->GetStateLock ())
110112#define ALE_GLOBAL_STATE (uint32)(-1 )
111113
112114#define ALE_GAME_API AC_GAME_API
@@ -123,6 +125,7 @@ class ALE_GAME_API ALE
123125 const std::string& GetRequireCPath () const { return lua_requirecpath; }
124126
125127 LockType& GetStateLock () { return stateLock; }
128+ static LockType& GetNoopLock () { static LockType noop; return noop; }
126129 uint32 GetStateMapId () const { return stateMapId; }
127130 uint32 GetStateInstanceId () const { return stateInstanceId; }
128131 ALE** GetSelfPtr () { return selfPtr ? selfPtr : &ALE::GALE; }
You can’t perform that action at this time.
0 commit comments