summaryrefslogtreecommitdiff
path: root/drivers/windows/thread_windows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/windows/thread_windows.cpp')
-rw-r--r--drivers/windows/thread_windows.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/windows/thread_windows.cpp b/drivers/windows/thread_windows.cpp
index d5e489aab4..884575e81e 100644
--- a/drivers/windows/thread_windows.cpp
+++ b/drivers/windows/thread_windows.cpp
@@ -32,6 +32,7 @@
#include "os/memory.h"
+
Thread::ID ThreadWindows::get_ID() const {
return id;
@@ -45,8 +46,14 @@ Thread* ThreadWindows::create_thread_windows() {
DWORD ThreadWindows::thread_callback( LPVOID userdata ) {
ThreadWindows *t=reinterpret_cast<ThreadWindows*>(userdata);
- t->callback(t->user);
+
+ ScriptServer::thread_enter(); //scripts may need to attach a stack
+
t->id=(ID)GetCurrentThreadId(); // must implement
+ t->callback(t->user);
+
+ ScriptServer::thread_exit();
+
return 0;
}