Changeset 281 for trunk/src/kernel32/thread.cpp
- Timestamp:
- Jul 7, 1999, 10:11:58 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/thread.cpp
r126 r281 1 /* $Id: thread.cpp,v 1. 6 1999-06-20 10:55:36sandervl Exp $ */1 /* $Id: thread.cpp,v 1.7 1999-07-07 08:11:10 sandervl Exp $ */ 2 2 3 3 /* … … 14 14 #include "thread.h" 15 15 #include "except.h" 16 #include "misc.h"16 #include <misc.h> 17 17 #include <wprocess.h> 18 #include <windll.h> 19 #include <winexe.h> 18 20 19 21 static DWORD OPEN32API Win32ThreadProc(LPVOID lpData); … … 46 48 DWORD WIN32API GetCurrentThreadId() 47 49 { 48 dprintf(("GetCurrentThreadId\n")); 49 50 //// dprintf(("GetCurrentThreadId\n")); 50 51 return(O32_GetCurrentThreadId()); 51 52 } … … 121 122 exitcode)); 122 123 123 #ifdef WIN32_TIBSEL 124 Win32Dll::detachThreadFromAllDlls(); //send DLL_THREAD_DETACH message to all dlls 125 Win32Dll::tlsDetachThreadFromAllDlls(); //destroy TLS structures of all dlls 126 WinExe->tlsDetachThread(); //destroy TLS structure of main exe 124 127 DestroyTIB(); 125 #endif126 128 O32_ExitThread(exitcode); 127 129 } … … 153 155 WIN32THREADPROC winthread = me->pCallback; 154 156 LPVOID userdata = me->lpUserData; 157 DWORD rc; 155 158 156 159 delete me; //only called once … … 158 161 dprintf(("Win32ThreadProc %d\n", GetCurrentThreadId())); 159 162 160 #ifdef WIN32_TIBSEL161 163 TEB *winteb = (TEB *)InitializeTIB(); 162 164 if(winteb == NULL) { … … 170 172 thdb->entry_point = (void *)winthread; 171 173 thdb->entry_arg = (void *)userdata; 174 172 175 SetWin32TIB(); 173 #else 174 ReplaceExceptionHandler(); 175 #endif 176 return(winthread(userdata)); 176 WinExe->tlsAttachThread(); //setup TLS structure of main exe 177 Win32Dll::tlsAttachThreadToAllDlls(); //setup TLS structures of all dlls 178 Win32Dll::attachThreadToAllDlls(); //send DLL_THREAD_ATTACH message to all dlls 179 180 rc = winthread(userdata); 181 182 Win32Dll::detachThreadFromAllDlls(); //send DLL_THREAD_DETACH message to all dlls 183 Win32Dll::tlsDetachThreadFromAllDlls(); //destroy TLS structures of all dlls 184 WinExe->tlsDetachThread(); //destroy TLS structure of main exe 185 DestroyTIB(); 186 return rc; 177 187 } 178 188 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.