Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void my_suppress_lock()
- {
- supress = true;
- }
- void my_allow_lock()
- {
- supress = false;
- }
- const char *my_call(lua_State *L, int arguments, int results)
- {
- if (supress)
- {
- if (!lua_isfunction(L, -(arguments+1)))
- {
- auto err = lua_tostring(L, -1);
- lua_remove(L, -1);
- return err;
- }
- if (lua_pcall(L, arguments, results, 0) != 0)
- {
- auto err = lua_tostring(L, -1);
- lua_remove(L, -1);
- return err;
- }
- return 0;
- }
- concurrency::critical_section ::scoped_lock slock(lock);
- if (!lua_isfunction(L, -(arguments+1)))
- {
- auto err = lua_tostring(L, -1);
- lua_remove(L, -1);
- return err;
- }
- if (lua_pcall(L, arguments, results, 0) != 0)
- {
- auto err = lua_tostring(L, -1);
- lua_remove(L, -1);
- return err;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment