VirtualBox

Changeset 21933 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 2, 2009 6:03:04 PM (15 years ago)
Author:
vboxsync
Message:

rtSemSpinMutexEnter: Fixed calls to RTThreadPreemptDisable with uninitialized state.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c

    r21593 r21933  
    123123    if (!pThis)
    124124        return VERR_NO_MEMORY;
    125     pThis->u32Magic  = RTSEMSPINMUTEX_MAGIC;
    126     pThis->fFlags    = fFlags;
    127     pThis->hOwner    = NIL_RTNATIVETHREAD;
    128     pThis->cLockers  = 0;
     125    pThis->u32Magic   = RTSEMSPINMUTEX_MAGIC;
     126    pThis->fFlags     = fFlags;
     127    pThis->hOwner     = NIL_RTNATIVETHREAD;
     128    pThis->cLockers   = 0;
    129129    rc = RTSemEventCreate(&pThis->hEventSem);
    130130    if (RT_SUCCESS(rc))
     
    150150static int rtSemSpinMutexEnter(RTSEMSPINMUTEXSTATE *pState, RTSEMSPINMUTEXINTERNAL *pThis)
    151151{
    152     int rc = VINF_SUCCESS;
     152#ifndef RT_OS_WINDOWS
     153    RTTHREADPREEMPTSTATE const StateInit = RTTHREADPREEMPTSTATE_INITIALIZER;
     154#endif
     155    int rc  = VINF_SUCCESS;
    153156
    154157    /** @todo Later #1: When entering in interrupt context and we're not able to
     
    192195        pState->fSpin = true;
    193196    }
     197    pState->PreemptState = StateInit;
    194198    RTThreadPreemptDisable(&pState->PreemptState);
    195199
     
    202206        return VERR_SEM_BAD_CONTEXT;
    203207    pState->fSpin = !RTThreadPreemptIsEnabled(NIL_RTTHREAD);
     208    pState->PreemptState = StateInit;
    204209    RTThreadPreemptDisable(&pState->PreemptState);
    205210#endif
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