Changeset 403 in vbox for trunk/src/VBox/Runtime/include/internal
- Timestamp:
- Jan 28, 2007 8:45:05 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 17974
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/include/internal/thread.h
r197 r403 25 25 #include <iprt/types.h> 26 26 #include <iprt/thread.h> 27 #include <iprt/avl.h> 27 28 #ifdef IN_RING3 28 29 # include <iprt/process.h> 29 30 # include <iprt/critsect.h> 30 # include <iprt/avl.h>31 31 #endif 32 32 33 33 __BEGIN_DECLS 34 34 35 36 #ifdef IN_RING337 35 38 36 … … 89 87 /** The current thread state. */ 90 88 RTTHREADSTATE volatile enmState; 91 #if def __WIN__89 #if defined(__WIN__) && defined(IN_RING3) 92 90 /** The thread handle. 93 91 * This is not valid until the create function has returned! */ … … 112 110 /** Actual stack size. */ 113 111 size_t cbStack; 112 #ifdef IN_RING3 114 113 /** What we're blocking on. */ 115 114 union RTTHREADINTBLOCKID … … 127 126 /** Where we're blocking. */ 128 127 RTUINTPTR volatile uBlockId; 128 #endif /* IN_RING3 */ 129 129 /** Thread name. */ 130 130 char szName[RTTHREAD_NAME_LEN]; … … 154 154 * Initialize the native part of the thread management. 155 155 * 156 * Generally a TLS entry will be allocated at this point .156 * Generally a TLS entry will be allocated at this point (Ring-3). 157 157 * 158 158 * @returns iprt status code. 159 159 */ 160 160 int rtThreadNativeInit(void); 161 162 /** 163 * Create a native thread. 164 * This creates the thread as described in pThreadInt and stores the thread id in *pThread. 165 * 166 * @returns iprt status code. 167 * @param pThreadInt The thread data structure for the thread. 168 * @param pNativeThread Where to store the native thread identifier. 169 */ 170 int rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread); 171 172 /** 173 * Adopts a thread, this is called immediately after allocating the 174 * thread structure. 175 * 176 * @param pThread Pointer to the thread structure. 177 */ 178 int rtThreadNativeAdopt(PRTTHREADINT pThread); 161 179 162 180 /** … … 174 192 int rtThreadNativeSetPriority(PRTTHREADINT pThread, RTTHREADTYPE enmType); 175 193 176 /** 177 * Create a native thread. 178 * This creates the thread as described in pThreadInt and stores the thread id in *pThread. 179 * 180 * @returns iprt status code. 181 * @param pThreadInt The thread data structure for the thread. 182 * @param pNativeThread Where to store the native thread identifier. 183 */ 184 int rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread); 185 186 /** 187 * Adopts a thread, this is called immediately after allocating the 188 * thread structure. 189 * 190 * @param pThread Pointer to the thread structure. 191 */ 192 int rtThreadNativeAdopt(PRTTHREADINT pThread); 193 194 #ifdef __WIN__ 194 #ifdef IN_RING3 195 # ifdef __WIN__ 195 196 /** 196 197 * Callback for when a native thread is detaching. … … 200 201 */ 201 202 void rtThreadNativeDetach(void); 202 #endif 203 204 int rtThreadInit(void); 203 # endif 204 #endif /* !IN_RING0 */ 205 206 207 /* thread.cpp */ 205 208 int rtThreadMain(PRTTHREADINT pThread, RTNATIVETHREAD NativeThread); 206 void rtThreadInsert(PRTTHREADINT pThread, RTNATIVETHREAD NativeThread);207 PRTTHREADINT rtThreadGetByNative(RTNATIVETHREAD NativeThread);208 PRTTHREADINT rtThreadGet(RTTHREAD Thread);209 uint32_t rtThreadRelease(PRTTHREADINT pThread);210 int rtThreadDoSetProcPriority(RTPROCPRIORITY enmPriority);211 void rtThreadTerminate(PRTTHREADINT pThread, int rc);212 209 void rtThreadBlocking(PRTTHREADINT pThread, RTTHREADSTATE enmState, uint64_t u64Block, 213 210 const char *pszFile, unsigned uLine, RTUINTPTR uId); 214 211 void rtThreadUnblocked(PRTTHREADINT pThread, RTTHREADSTATE enmCurState); 215 216 217 #elif defined(IN_RING0) 218 219 /** 220 * Argument package for a ring-0 thread. 221 */ 222 typedef struct RTR0THREADARGS 223 { 224 /** The thread function. */ 225 PFNRTTHREAD pfnThread; 226 /** The thread function argument. */ 227 void *pvUser; 228 /** The thread type. */ 229 RTTHREADTYPE enmType; 230 } RTR0THREADARGS, *PRTR0THREADARGS; 231 232 233 234 int rtThreadMain(PRTR0THREADARGS pArgs, RTNATIVETHREAD NativeThread); 235 236 /** 237 * Do the actual thread creation. 238 * 239 * @returns IPRT status code. 240 * On failure, no thread has been created. 241 * @param pArgs The argument package. 242 * @param pNativeThread Where to return the native thread handle. 243 */ 244 int rtThreadNativeCreate(PRTR0THREADARGS pArgs, PRTNATIVETHREAD pNativeThread); 245 246 /** 247 * Do the actual thread priority change. 248 * 249 * @returns IPRT status code. 250 * @param Thread The thread which priority should be changed. 251 * This is currently restricted to the current thread. 252 * @param enmType The new thread priority type (valid). 253 */ 254 int rtThreadNativeSetPriority(RTTHREAD Thread, RTTHREADTYPE enmType); 255 212 uint32_t rtThreadRelease(PRTTHREADINT pThread); 213 void rtThreadTerminate(PRTTHREADINT pThread, int rc); 214 PRTTHREADINT rtThreadGetByNative(RTNATIVETHREAD NativeThread); 215 PRTTHREADINT rtThreadGet(RTTHREAD Thread); 216 int rtThreadInit(void); 217 void rtThreadTerm(void); 218 void rtThreadInsert(PRTTHREADINT pThread, RTNATIVETHREAD NativeThread); 219 #ifdef IN_RING3 220 int rtThreadDoSetProcPriority(RTPROCPRIORITY enmPriority); 256 221 #endif /* !IN_RING0 */ 257 222
Note:
See TracChangeset
for help on using the changeset viewer.