VirtualBox

Changeset 403 in vbox for trunk/src/VBox/Runtime/r0drv/nt


Ignore:
Timestamp:
Jan 28, 2007 8:45:05 AM (18 years ago)
Author:
vboxsync
Message:

Need RTThreadWait in ring-0 too when using the generic timers, so thread.cpp was ported to ring-0. Fixed a bug in RTTimerStart() (the generic code). (hope this doesn't break the other platforms...)

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  
    3333
    3434
    35 RTDECL(RTTHREAD) RTThreadSelf(void)
     35RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void)
    3636{
    37     return (RTTHREAD)PsGetCurrentThread();
     37    return (RTNATIVETHREAD)PsGetCurrentThread();
    3838}
    3939
     
    6262}
    6363
     64
  • trunk/src/VBox/Runtime/r0drv/nt/thread2-r0drv-nt.cpp

    r375 r403  
    11/* $Id$ */
    22/** @file
    3  * InnoTek Portable Runtime - Threads, Ring-0 Driver, NT.
     3 * InnoTek Portable Runtime - Threads (Part 2), Ring-0 Driver, NT.
    44 */
    55
     
    2828#include <iprt/err.h>
    2929
    30 __BEGIN_DECLS
    31 NTSTATUS NTAPI ZwYieldExecution(void);
    32 __END_DECLS
     30#include "internal/thread.h"
    3331
    3432
    3533RTDECL(RTTHREAD) RTThreadSelf(void)
    3634{
    37     return (RTTHREAD)PsGetCurrentThread();
     35    return rtThreadGetByNative((RTNATIVETHREAD)PsGetCurrentThread());
    3836}
    3937
    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.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette