summaryrefslogtreecommitdiff
path: root/drivers/unix/thread_posix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix/thread_posix.cpp')
-rw-r--r--drivers/unix/thread_posix.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp
index 6ace64a923..c71e09685b 100644
--- a/drivers/unix/thread_posix.cpp
+++ b/drivers/unix/thread_posix.cpp
@@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "thread_posix.h"
+#include "script_language.h"
#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)
@@ -50,7 +51,13 @@ void *ThreadPosix::thread_callback(void *userdata) {
ThreadPosix *t=reinterpret_cast<ThreadPosix*>(userdata);
t->id=(ID)pthread_self();
+
+ ScriptServer::thread_enter(); //scripts may need to attach a stack
+
t->callback(t->user);
+
+ ScriptServer::thread_exit();
+
return NULL;
}