diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-25 17:55:31 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-25 17:55:31 +0100 |
commit | 051a587071e1bd25f72c77e84443be4a3426c83d (patch) | |
tree | 1a0bbf1a90f841a99985834b0509558495a66d15 /src/state.cpp | |
parent | 0c060e6e4b9f99dc887b5dfebdae76fcde9524f1 (diff) | |
download | lanes-051a587071e1bd25f72c77e84443be4a3426c83d.tar.gz lanes-051a587071e1bd25f72c77e84443be4a3426c83d.tar.bz2 lanes-051a587071e1bd25f72c77e84443be4a3426c83d.zip |
C++ migration: Universe MUTEX_T replaced with std::mutex and std::atomic
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state.cpp b/src/state.cpp index aa6b38a..c66242c 100644 --- a/src/state.cpp +++ b/src/state.cpp | |||
@@ -72,11 +72,11 @@ static int luaG_new_require( lua_State* L) | |||
72 | 72 | ||
73 | // Using 'lua_pcall()' to catch errors; otherwise a failing 'require' would | 73 | // Using 'lua_pcall()' to catch errors; otherwise a failing 'require' would |
74 | // leave us locked, blocking any future 'require' calls from other lanes. | 74 | // leave us locked, blocking any future 'require' calls from other lanes. |
75 | 75 | ||
76 | MUTEX_LOCK( &U->require_cs); | 76 | U->require_cs.lock(); |
77 | // starting with Lua 5.4, require may return a second optional value, so we need LUA_MULTRET | 77 | // starting with Lua 5.4, require may return a second optional value, so we need LUA_MULTRET |
78 | rc = lua_pcall( L, args, LUA_MULTRET, 0 /*errfunc*/ ); // err|result(s) | 78 | rc = lua_pcall( L, args, LUA_MULTRET, 0 /*errfunc*/ ); // err|result(s) |
79 | MUTEX_UNLOCK( &U->require_cs); | 79 | U->require_cs.unlock(); |
80 | 80 | ||
81 | // the required module (or an error message) is left on the stack as returned value by original require function | 81 | // the required module (or an error message) is left on the stack as returned value by original require function |
82 | 82 | ||