diff options
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 | ||