Changeset 2085 for trunk/src/kernel32/wprocess.cpp
- Timestamp:
- Dec 16, 1999, 1:12:55 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/wprocess.cpp
r2077 r2085 1 /* $Id: wprocess.cpp,v 1.5 8 1999-12-14 19:14:28sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.59 1999-12-16 00:12:55 sandervl Exp $ */ 2 2 3 3 /* … … 5 5 * 6 6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl) 7 *8 7 * 9 8 * NOTE: Even though Odin32 OS/2 apps don't switch FS selectors, … … 25 24 #include <windllpeldr.h> 26 25 #include <winfakepeldr.h> 26 #include <vmutex.h> 27 27 28 28 #ifdef __IBMCPP__ … … 53 53 DWORD *TIBFlatPtr = 0; 54 54 55 //list of thread database structures 56 static THDB *threadList = 0; 57 static VMutex threadListMutex; 55 58 //****************************************************************************** 56 59 //****************************************************************************** … … 79 82 80 83 return thdb; 84 } 85 //****************************************************************************** 86 //****************************************************************************** 87 THDB *WIN32API GetTHDBFromThreadId(ULONG threadId) 88 { 89 THDB *thdb = threadList; 90 91 threadListMutex.enter(); 92 while(thdb) { 93 if(thdb->threadId == threadId) { 94 break; 95 } 96 thdb = thdb->next; 97 } 98 threadListMutex.leave(); 99 return thdb; 81 100 } 82 101 //****************************************************************************** … … 133 152 thdb->OrgTIBSel = GetFS(); 134 153 thdb->pWsockData = NULL; 154 thdb->threadId = GetCurrentThreadId(); 155 156 threadListMutex.enter(); 157 THDB *thdblast = threadList; 158 if(!thdblast) { 159 threadList = thdb; 160 } 161 else { 162 while(thdblast->next) { 163 thdblast = thdblast->next; 164 } 165 thdblast->next = thdb; 166 } 167 thdb->next = NULL; 168 threadListMutex.leave(); 135 169 136 170 if(OSLibGetPIB(PIB_TASKTYPE) == TASKTYPE_PM) 137 171 { 138 thdb->flags = 0; //todo gui172 thdb->flags = 0; //todo gui 139 173 } 140 174 else thdb->flags = 0; //todo textmode … … 145 179 //todo: initialize TLS array if required 146 180 //TLS in executable always TLS index 0? 147 ProcessTIBSel = tibsel;181 ProcessTIBSel = tibsel; 148 182 ProcessPDB.exit_code = 0x103; /* STILL_ACTIVE */ 149 183 ProcessPDB.threads = 1; … … 159 193 ProcessPDB.server_pid = (void *)GetCurrentProcessId(); 160 194 161 GetSystemTime(&ProcessPDB.creationTime);195 GetSystemTime(&ProcessPDB.creationTime); 162 196 163 197 /* Initialize the critical section */
Note:
See TracChangeset
for help on using the changeset viewer.