VirtualBox

Changeset 44228 in vbox for trunk/src


Ignore:
Timestamp:
Jan 2, 2013 12:24:08 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83036
Message:

tstRTR0Timer.cpp: Attempt at fixing test failures i the CSSD_LOOP.

File:
1 edited

Legend:

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

    r39083 r44228  
    400400            do /* break loop */
    401401            {
    402                 RT_ZERO(State);
     402                RT_ZERO(State); ASMAtomicWriteU32(&State.cShots, State.cShots);
    403403                RTR0TESTR0_CHECK_RC_BREAK(RTTimerStart(pTimer, 0), VINF_SUCCESS);
    404404                for (uint32_t i = 0; i < 1000 && !ASMAtomicUoReadU32(&State.cShots); i++)
     
    407407
    408408                /* check that it is restartable. */
    409                 RT_ZERO(State);
     409                RT_ZERO(State); ASMAtomicWriteU32(&State.cShots, State.cShots);
    410410                RTR0TESTR0_CHECK_RC_BREAK(RTTimerStart(pTimer, 0), VINF_SUCCESS);
    411411                for (uint32_t i = 0; i < 1000 && !ASMAtomicUoReadU32(&State.cShots); i++)
     
    414414
    415415                /* check that it respects the timeout value and can be cancelled. */
    416                 RT_ZERO(State);
     416                RT_ZERO(State); ASMAtomicWriteU32(&State.cShots, State.cShots);
    417417                RTR0TESTR0_CHECK_RC(RTTimerStart(pTimer, 5*UINT64_C(1000000000)), VINF_SUCCESS);
    418418                RTR0TESTR0_CHECK_RC(RTTimerStop(pTimer), VINF_SUCCESS);
     
    421421
    422422                /* Check some double starts and stops (shall not assert). */
    423                 RT_ZERO(State);
     423                RT_ZERO(State); ASMAtomicWriteU32(&State.cShots, State.cShots);
    424424                RTR0TESTR0_CHECK_RC(RTTimerStart(pTimer, 5*UINT64_C(1000000000)), VINF_SUCCESS);
    425425                RTR0TESTR0_CHECK_RC(RTTimerStart(pTimer, 0), VERR_TIMER_ACTIVE);
     
    448448                RT_ZERO(State);
    449449                State.iActionShot = 0;
     450                ASMAtomicWriteU32(&State.cShots, State.cShots);
    450451                do /* break loop */
    451452                {
     
    476477                State.rc = VERR_IPE_UNINITIALIZED_STATUS;
    477478                State.iActionShot = 0;
     479                ASMAtomicWriteU32(&State.cShots, State.cShots);
    478480                do /* break loop */
    479481                {
     
    504506                    State.rc                = VINF_SUCCESS;
    505507                    State.u.Specific.idCpu  = RTMpCpuIdFromSetIndex(iCpu);
     508                    ASMAtomicWriteU32(&State.cShots, State.cShots);
    506509
    507510                    uint32_t fFlags = TSTRTR0TIMER_IS_HIRES(uOperation) ? RTTIMER_FLAGS_HIGH_RES : 0;
     
    557560                RT_ZERO(State);
    558561                State.fPeriodic = true;
     562                ASMAtomicWriteU32(&State.cShots, State.cShots);
     563
    559564                uint64_t uStartNsTS = RTTimeSystemNanoTS();
    560565                RTR0TESTR0_CHECK_RC_BREAK(RTTimerStart(pTimer, u10HzAsNs), VINF_SUCCESS);
     
    585590                    RT_ZERO(State);
    586591                    State.fPeriodic = true;
     592                    ASMAtomicWriteU32(&State.cShots, State.cShots); /* ordered, necessary? */
     593
    587594                    RTR0TESTR0_CHECK_RC_BREAK(RTTimerStart(pTimer, i < 20 ? 0 : cNsSysHz), VINF_SUCCESS);
    588595                    for (uint32_t k = 0; k < 1000 && ASMAtomicUoReadU32(&State.cShots) < 2; k++)
     
    621628            RTR0TESTR0_CHECK_MSG_BREAK(State.u.ChgInt.cNsMinInterval > 1000, ("%u\n", State.u.ChgInt.cNsMinInterval));
    622629            RTR0TESTR0_CHECK_MSG_BREAK(State.u.ChgInt.cNsMaxInterval > State.u.ChgInt.cNsMinInterval, ("max=%u min=%u\n", State.u.ChgInt.cNsMaxInterval, State.u.ChgInt.cNsMinInterval));
     630            ASMAtomicWriteU32(&State.cShots, State.cShots);
    623631
    624632            /* create the timer and check if RTTimerChangeInterval is supported. */
     
    664672                    State.fPeriodic         = true;
    665673                    State.u.Specific.idCpu  = RTMpCpuIdFromSetIndex(iCpu);
     674                    ASMAtomicWriteU32(&State.cShots, State.cShots);
    666675
    667676                    uint32_t fFlags = TSTRTR0TIMER_IS_HIRES(uOperation) ? RTTIMER_FLAGS_HIGH_RES : 0;
Note: See TracChangeset for help on using the changeset viewer.

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