diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-25 10:40:33 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-25 10:41:23 -0300 |
commit | 8dac3bf3b10406d05c4d520e81082e490e3b76ff (patch) | |
tree | fa7cd3a9a8f5758855969bf8488b6cd141eb1bbc /core/script_language.h | |
parent | c931ed976b5952d7f0972f4c8c4efe279db456ac (diff) | |
download | redot-engine-8dac3bf3b10406d05c4d520e81082e490e3b76ff.tar.gz |
Added function to notify ScriptLanguage when a thread is created/freed, allows scripts to allocate a stack there via TLS
Diffstat (limited to 'core/script_language.h')
-rw-r--r-- | core/script_language.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/script_language.h b/core/script_language.h index bde4d619ab..de725d8d08 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -59,6 +59,9 @@ public: static void set_reload_scripts_on_save(bool p_enable); static bool is_reload_scripts_on_save_enabled(); + static void thread_enter(); + static void thread_exit(); + static void init_languages(); }; @@ -128,7 +131,6 @@ public: virtual void call_multilevel_reversed(const StringName& p_method,const Variant** p_args,int p_argcount); virtual void notification(int p_notification)=0; - //this is used by script languages that keep a reference counter of their own //you can make make Ref<> not die when it reaches zero, so deleting the reference //depends entirely from the script @@ -183,6 +185,12 @@ public: virtual void auto_indent_code(String& p_code,int p_from_line,int p_to_line) const=0; virtual void add_global_constant(const StringName& p_variable,const Variant& p_value)=0; + /* MULTITHREAD FUNCTIONS */ + + //some VMs need to be notified of thread creation/exiting to allocate a stack + virtual void thread_enter() {} + virtual void thread_exit() {} + /* DEBUGGER FUNCTIONS */ virtual String debug_get_error() const=0; |