VirtualBox

Changeset 8661 in vbox for trunk/src


Ignore:
Timestamp:
May 7, 2008 2:40:30 PM (17 years ago)
Author:
vboxsync
Message:

Another attempt - don't call rtThreadRemove twice and if we do call it, make sure cRefs != 0.

File:
1 edited

Legend:

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

    r8658 r8661  
    526526    /*
    527527     * Remove it from the tree and mark it as dead.
    528      */
    529     rtThreadRemove(pThread);
     528     *
     529     * Thread that has seen rtThreadTerminate and entered the final TERMINATED
     530     * state does not need removing, probably no thread should require removing
     531     * here. However, be careful making sure that cRefs isn't 0 if we do or we'll
     532     * blow up because the strict locking code will be calling us back.
     533     */
     534    if (pThread->enmState != RTTHREADSTATE_TERMINATED)
     535    {
     536        ASMAtomicIncU32(&pThread->cRefs);
     537        rtThreadRemove(pThread);
     538        ASMAtomicDecU32(&pThread->cRefs);
     539    }
    530540    ASMAtomicXchgU32(&pThread->u32Magic, RTTHREADINT_MAGIC_DEAD);
    531541
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