Added function to notify ScriptLanguage when a thread is created/freed, allows scripts to allocate a stack there via TLS

This commit is contained in:
Juan Linietsky
2016-06-25 10:40:33 -03:00
parent c931ed976b
commit 8dac3bf3b1
7 changed files with 49 additions and 5 deletions

View File

@ -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;