VirtualBox

Changeset 19498 in vbox


Ignore:
Timestamp:
May 7, 2009 6:08:16 PM (16 years ago)
Author:
vboxsync
Message:

TMAll.cpp: Drop two wrong assertions in TMTimerSet (the queue might be rescheduled at the same time).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/TMAll.cpp

    r19492 r19498  
    552552         */
    553553        TMTIMERSTATE enmState = pTimer->enmState;
    554         Log2(("TMTimerDestroy: pTimer=%p:{.enmState=%s, .pszDesc='%s'} cRetries=%d\n",
     554        Log2(("TMTimerDestroy: %p:{.enmState=%s, .pszDesc='%s'} cRetries=%d\n",
    555555              pTimer, tmTimerState(enmState), R3STRING(pTimer->pszDesc), cRetries));
    556556        switch (enmState)
     
    653653         */
    654654        TMTIMERSTATE    enmState = pTimer->enmState;
    655         Log2(("TMTimerSet: pTimer=%p:{.enmState=%s, .pszDesc='%s'} cRetries=%d u64Expire=%llu\n",
     655        Log2(("TMTimerSet: %p:{.enmState=%s, .pszDesc='%s'} cRetries=%d u64Expire=%llu\n",
    656656              pTimer, tmTimerState(enmState), R3STRING(pTimer->pszDesc), cRetries, u64Expire));
    657657        switch (enmState)
     
    679679                if (tmTimerTry(pTimer, TMTIMERSTATE_PENDING_SCHEDULE_SET_EXPIRE, enmState))
    680680                {
    681                     Assert(!pTimer->offPrev);
    682                     Assert(!pTimer->offNext);
    683681                    pTimer->u64Expire = u64Expire;
    684682                    TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_SCHEDULE);
     
    865863         */
    866864        TMTIMERSTATE    enmState = pTimer->enmState;
    867         Log2(("TMTimerStop: pTimer=%p:{.enmState=%s, .pszDesc='%s'} cRetries=%d\n",
     865        Log2(("TMTimerStop: %p:{.enmState=%s, .pszDesc='%s'} cRetries=%d\n",
    868866              pTimer, tmTimerState(enmState), R3STRING(pTimer->pszDesc), cRetries));
    869867        switch (enmState)
     
    13511349    switch (enmState)
    13521350    {
    1353 #define CASE(state) case state: return #state + sizeof("TMTIMERSTATE_") - 1
    1354         CASE(TMTIMERSTATE_STOPPED);
    1355         CASE(TMTIMERSTATE_ACTIVE);
    1356         CASE(TMTIMERSTATE_EXPIRED);
    1357         CASE(TMTIMERSTATE_PENDING_STOP);
    1358         CASE(TMTIMERSTATE_PENDING_STOP_SCHEDULE);
    1359         CASE(TMTIMERSTATE_PENDING_SCHEDULE_SET_EXPIRE);
    1360         CASE(TMTIMERSTATE_PENDING_SCHEDULE);
    1361         CASE(TMTIMERSTATE_PENDING_RESCHEDULE_SET_EXPIRE);
    1362         CASE(TMTIMERSTATE_PENDING_RESCHEDULE);
    1363         CASE(TMTIMERSTATE_PENDING_STOP_DESTROY);
    1364         CASE(TMTIMERSTATE_PENDING_DESTROY);
    1365         CASE(TMTIMERSTATE_FREE);
     1351#define CASE(num, state) \
     1352            case TMTIMERSTATE_##state: \
     1353                AssertCompile(TMTIMERSTATE_##state == (num)); \
     1354                return #num "-" #state
     1355        CASE( 1,STOPPED);
     1356        CASE( 2,ACTIVE);
     1357        CASE( 3,EXPIRED);
     1358        CASE( 4,PENDING_STOP);
     1359        CASE( 5,PENDING_STOP_SCHEDULE);
     1360        CASE( 6,PENDING_SCHEDULE_SET_EXPIRE);
     1361        CASE( 7,PENDING_SCHEDULE);
     1362        CASE( 8,PENDING_RESCHEDULE_SET_EXPIRE);
     1363        CASE( 9,PENDING_RESCHEDULE);
     1364        CASE(10,PENDING_STOP_DESTROY);
     1365        CASE(11,PENDING_DESTROY);
     1366        CASE(12,FREE);
    13661367        default:
    13671368            AssertMsgFailed(("Invalid state enmState=%d\n", enmState));
     
    16001601         * Do the scheduling.
    16011602         */
    1602         Log2(("tmTimerQueueSchedule: pTimer=%p:{.enmState=%s, .enmClock=%d, .enmType=%d, .pszDesc=%s}\n",
     1603        Log2(("tmTimerQueueSchedule: %p:{.enmState=%s, .enmClock=%d, .enmType=%d, .pszDesc=%s}\n",
    16031604              pTimer, tmTimerState(pTimer->enmState), pTimer->enmClock, pTimer->enmType, R3STRING(pTimer->pszDesc)));
    16041605        tmTimerQueueScheduleOne(pQueue, pTimer);
    1605         Log2(("tmTimerQueueSchedule: new %s\n", tmTimerState(pTimer->enmState)));
     1606        Log2(("tmTimerQueueSchedule: %p: new %s\n", pTimer, tmTimerState(pTimer->enmState)));
    16061607    } /* foreach timer in current schedule batch. */
    16071608}
     
    16361637            {
    16371638                case TMTIMERSTATE_ACTIVE:
    1638                     AssertMsg(!pCur->offScheduleNext, ("%s: %RI32\n", pszWhere, pCur->offScheduleNext));
     1639                    AssertMsg(  !pCur->offScheduleNext
     1640                              || pCur->enmState != TMTIMERSTATE_ACTIVE,
     1641                              ("%s: %RI32\n", pszWhere, pCur->offScheduleNext));
    16391642                    break;
    16401643                case TMTIMERSTATE_PENDING_STOP:
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