VirtualBox

Ignore:
Timestamp:
Nov 10, 2008 1:46:18 PM (16 years ago)
Author:
vboxsync
Message:

pReq may be invalid after queuing it (RTREQFLAGS_NO_WAIT), similar to r27120.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/req.cpp

    r13837 r14012  
    659659     * Insert it.
    660660     */
     661    PRTREQQUEUE pQueue = ((RTREQ volatile *)pReq)->pQueue;                 /* volatile paranoia */
     662    unsigned fFlags = ((RTREQ volatile *)pReq)->fFlags;                    /* volatile paranoia */
    661663    pReq->enmState = RTREQSTATE_QUEUED;
    662664    PRTREQ pNext;
    663665    do
    664666    {
    665         pNext = pReq->pQueue->pReqs;
     667        pNext = pQueue->pReqs;
    666668        pReq->pNext = pNext;
    667     } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pReq->pQueue->pReqs, (void *)pReq, (void *)pNext));
     669    } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pQueue->pReqs, (void *)pReq, (void *)pNext));
    668670
    669671    /*
    670672     * Notify queue thread.
    671673     */
    672     RTSemEventSignal(pReq->pQueue->EventSem);
     674    RTSemEventSignal(pQueue->EventSem);
    673675
    674676    /*
    675677     * Wait and return.
    676678     */
    677     if (!(pReq->fFlags & RTREQFLAGS_NO_WAIT))
     679    if (!(fFlags & RTREQFLAGS_NO_WAIT))
    678680        rc = RTReqWait(pReq, cMillies);
    679681    LogFlow(("RTReqQueue: returns %Rrc\n", rc));
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