summaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/cpp_api/s_base.h')
-rw-r--r--src/script/cpp_api/s_base.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/script/cpp_api/s_base.h b/src/script/cpp_api/s_base.h
index d653b5bac..f52474f00 100644
--- a/src/script/cpp_api/s_base.h
+++ b/src/script/cpp_api/s_base.h
@@ -28,15 +28,15 @@ extern "C" {
}
#include "irrlichttypes.h"
-#include "jthread/jmutex.h"
-#include "jthread/jmutexautolock.h"
+#include "threads.h"
+#include "threading/mutex.h"
+#include "threading/mutex_auto_lock.h"
#include "common/c_types.h"
#include "common/c_internal.h"
#define SCRIPTAPI_LOCK_DEBUG
#define SCRIPTAPI_DEBUG
-#define SCRIPT_MOD_NAME_FIELD "current_mod_name"
// MUST be an invalid mod name so that mods can't
// use that name to bypass security!
#define BUILTIN_MOD_NAME "*builtin*"
@@ -64,9 +64,9 @@ public:
ScriptApiBase();
virtual ~ScriptApiBase();
- bool loadMod(const std::string &script_path, const std::string &mod_name,
- std::string *error=NULL);
- bool loadScript(const std::string &script_path, std::string *error=NULL);
+ // These throw a ModError on failure
+ void loadMod(const std::string &script_path, const std::string &mod_name);
+ void loadScript(const std::string &script_path);
void runCallbacksRaw(int nargs,
RunCallbacksMode mode, const char *fxn);
@@ -83,6 +83,7 @@ public:
protected:
friend class LuaABM;
+ friend class LuaLBM;
friend class InvRef;
friend class ObjectRef;
friend class NodeMetaRef;
@@ -108,13 +109,12 @@ protected:
void objectrefGetOrCreate(lua_State *L, ServerActiveObject *cobj);
void objectrefGet(lua_State *L, u16 id);
- JMutex m_luastackmutex;
+ RecursiveMutex m_luastackmutex;
std::string m_last_run_mod;
- // Stack index of Lua error handler
- int m_errorhandler;
bool m_secure;
#ifdef SCRIPTAPI_LOCK_DEBUG
- bool m_locked;
+ int m_lock_recursion_count;
+ threadid_t m_owning_thread;
#endif
private: