summaryrefslogtreecommitdiff
path: root/platform/android/thread_jandroid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/thread_jandroid.cpp')
-rw-r--r--platform/android/thread_jandroid.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/android/thread_jandroid.cpp b/platform/android/thread_jandroid.cpp
index 1425e23c73..aa40d995d9 100644
--- a/platform/android/thread_jandroid.cpp
+++ b/platform/android/thread_jandroid.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -29,6 +29,7 @@
#include "thread_jandroid.h"
#include "os/memory.h"
+#include "script_language.h"
Thread::ID ThreadAndroid::get_ID() const {
@@ -44,8 +45,10 @@ void *ThreadAndroid::thread_callback(void *userdata) {
ThreadAndroid *t=reinterpret_cast<ThreadAndroid*>(userdata);
setup_thread();
+ ScriptServer::thread_enter(); //scripts may need to attach a stack
t->id=(ID)pthread_self();
t->callback(t->user);
+ ScriptServer::thread_exit();
return NULL;
}
@@ -61,10 +64,12 @@ Thread* ThreadAndroid::create_func_jandroid(ThreadCreateCallback p_callback,void
return tr;
}
+
Thread::ID ThreadAndroid::get_thread_ID_func_jandroid() {
return (ID)pthread_self();
}
+
void ThreadAndroid::wait_to_finish_func_jandroid(Thread* p_thread) {
ThreadAndroid *tp=static_cast<ThreadAndroid*>(p_thread);