1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix Lua scripting synchronization

For several years now, the lua script lock has been completely broken.
This commit fixes the main issue (creation of a temporary rather than
scoped object), and fixes a subsequent deadlock issue caused by
nested script API calls by adding support for recursive mutexes.
This commit is contained in:
kwolekr 2015-10-31 16:31:43 -04:00
parent d198e420ec
commit 52e5b513ed
5 changed files with 57 additions and 17 deletions

View file

@ -28,6 +28,7 @@ extern "C" {
}
#include "irrlichttypes.h"
#include "threads.h"
#include "threading/mutex.h"
#include "threading/mutex_auto_lock.h"
#include "common/c_types.h"
@ -111,7 +112,8 @@ protected:
std::string m_last_run_mod;
bool m_secure;
#ifdef SCRIPTAPI_LOCK_DEBUG
bool m_locked;
int m_lock_recursion_count;
threadid_t m_owning_thread;
#endif
private: