Changeset 403 in vbox for trunk/src/VBox/Runtime/r0drv/nt
- Timestamp:
- Jan 28, 2007 8:45:05 AM (18 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/nt
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp
r1 r403 33 33 34 34 35 RTDECL(RT THREAD) RTThreadSelf(void)35 RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void) 36 36 { 37 return (RT THREAD)PsGetCurrentThread();37 return (RTNATIVETHREAD)PsGetCurrentThread(); 38 38 } 39 39 … … 62 62 } 63 63 64 -
trunk/src/VBox/Runtime/r0drv/nt/thread2-r0drv-nt.cpp
r375 r403 1 1 /* $Id$ */ 2 2 /** @file 3 * InnoTek Portable Runtime - Threads , Ring-0 Driver, NT.3 * InnoTek Portable Runtime - Threads (Part 2), Ring-0 Driver, NT. 4 4 */ 5 5 … … 28 28 #include <iprt/err.h> 29 29 30 __BEGIN_DECLS 31 NTSTATUS NTAPI ZwYieldExecution(void); 32 __END_DECLS 30 #include "internal/thread.h" 33 31 34 32 35 33 RTDECL(RTTHREAD) RTThreadSelf(void) 36 34 { 37 return (RTTHREAD)PsGetCurrentThread();35 return rtThreadGetByNative((RTNATIVETHREAD)PsGetCurrentThread()); 38 36 } 39 37 40 41 RTDECL(int) RTThreadSleep(unsigned cMillies)42 {43 LARGE_INTEGER Interval;44 Interval.QuadPart = -(int64_t)cMillies * 10000;45 NTSTATUS rcNt = KeDelayExecutionThread(KernelMode, TRUE, &Interval);46 switch (rcNt)47 {48 case STATUS_SUCCESS:49 return VINF_SUCCESS;50 case STATUS_ALERTED:51 case STATUS_USER_APC:52 return VERR_INTERRUPTED;53 default:54 return RTErrConvertFromNtStatus(rcNt);55 }56 }57 58 59 RTDECL(bool) RTThreadYield(void)60 {61 return ZwYieldExecution() != STATUS_NO_YIELD_PERFORMED;62 }63
Note:
See TracChangeset
for help on using the changeset viewer.