Changeset 7318 for trunk/src/kernel32/thread.cpp
- Timestamp:
- Nov 10, 2001, 1:47:48 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/thread.cpp
r6829 r7318 1 /* $Id: thread.cpp,v 1.3 2 2001-09-26 15:29:39 phallerExp $ */1 /* $Id: thread.cpp,v 1.33 2001-11-10 12:47:48 sandervl Exp $ */ 2 2 3 3 /* … … 31 31 #include "exceptutil.h" 32 32 #include "oslibmisc.h" 33 #include "oslibdos.h" 33 34 #include <handlemanager.h> 34 35 … … 126 127 O32_ExitThread(exitcode); 127 128 } 129 /***************************************************************************** 130 * Name : DWORD SetThreadAffinityMask 131 * Purpose : The SetThreadAffinityMask function sets a processor affinity 132 * mask for a specified thread. 133 * A thread affinity mask is a bit vector in which each bit 134 * represents the processors that a thread is allowed to run on. 135 * A thread affinity mask must be a proper subset of the process 136 * affinity mask for the containing process of a thread. A thread 137 * is only allowed to run on the processors its process is allowed to run on. 138 * Parameters: HANDLE hThread handle to the thread of interest 139 * DWORD dwThreadAffinityMask a thread affinity mask 140 * Variables : 141 * Result : TRUE / FALSE 142 * Remark : 143 * Status : UNTESTED STUB 144 * 145 * Author : Patrick Haller [Mon, 1998/06/15 08:00] 146 *****************************************************************************/ 147 148 DWORD WIN32API SetThreadAffinityMask(HANDLE hThread, 149 DWORD dwThreadAffinityMask) 150 { 151 dprintf(("KERNEL32: SetThreadAffinityMask(%08xh,%08xh)", 152 hThread, dwThreadAffinityMask)); 153 154 if(hThread != GetCurrentThread()) { 155 dprintf(("WARNING: Setting the affinity mask for another thread than the current one is not supported!!")); 156 return FALSE; 157 } 158 return OSLibDosSetThreadAffinity(dwThreadAffinityMask); 159 } 128 160 //****************************************************************************** 129 161 //****************************************************************************** … … 171 203 172 204 SetWin32TIB(); 205 206 DWORD dwProcessAffinityMask, dwSystemAffinityMask; 207 208 //Change the affinity mask of this thread to the mask for the whole process 209 if(GetProcessAffinityMask(GetCurrentProcess(), &dwProcessAffinityMask, &dwSystemAffinityMask) == TRUE) { 210 SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinityMask); 211 } 212 173 213 WinExe->tlsAttachThread(); //setup TLS structure of main exe 174 214 Win32DllBase::tlsAttachThreadToAllDlls(); //setup TLS structures of all dlls
Note:
See TracChangeset
for help on using the changeset viewer.