VirtualBox

Changeset 47520 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Aug 2, 2013 11:27:22 AM (11 years ago)
Author:
vboxsync
Message:

testcase/tstR0ThreadPreemption: More paranoid checks is good in testcases. Anything that -can- go wrong etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemption.cpp

    r47352 r47520  
    4848    uint32_t volatile   u32Magic;
    4949    RTCPUID             uSourceCpuId;
     50    RTNATIVETHREAD      hSourceThread;
    5051    RTTHREADCTX         hThreadCtx;
    5152
     
    9697            }
    9798
     99            RTNATIVETHREAD hCurrentThread = RTThreadNativeSelf();
     100            if (pData->hSourceThread != hCurrentThread)
     101            {
     102                RTStrPrintf(pData->achResult, sizeof(pData->achResult),
     103                            "!tstR0ThreadCtxHook[RTTHREADCTXEVENT_PREEMPTING]: Thread switched! Source=%RTnthrd Current=%RTnthrd.",
     104                            pData->hSourceThread, hCurrentThread);
     105            }
     106
    98107            RTCPUID uCurrentCpuId = RTMpCpuId();
    99108            if (pData->uSourceCpuId != uCurrentCpuId)
     
    121130                RTStrPrintf(pData->achResult, sizeof(pData->achResult),
    122131                            "!tstR0ThreadCtxHook[RTTHREADCTXEVENT_RESUMED]: Called before preempting callback was invoked.");
     132            }
     133
     134            RTNATIVETHREAD hCurrentThread = RTThreadNativeSelf();
     135            if (pData->hSourceThread != hCurrentThread)
     136            {
     137                RTStrPrintf(pData->achResult, sizeof(pData->achResult),
     138                            "!tstR0ThreadCtxHook[RTTHREADCTXEVENT_RESUMED]: Thread switched! Source=%RTnthrd Current=%RTnthrd.",
     139                            pData->hSourceThread, hCurrentThread);
    123140            }
    124141
     
    301318            pCtxData->fResumedInvoked    = false;
    302319            pCtxData->fResumedSuccess    = false;
     320            pCtxData->hSourceThread      = RTThreadNativeSelf();
    303321            RT_ZERO(pCtxData->achResult);
    304322
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