VirtualBox

Changeset 20273 in vbox


Ignore:
Timestamp:
Jun 4, 2009 12:16:28 PM (16 years ago)
Author:
vboxsync
Message:

Runtime/thread: paranoia check in strict builds for held rwsem locks on thread termination

File:
1 edited

Legend:

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

    r20008 r20273  
    634634    ASMAtomicWriteSize(&pThread->enmState, RTTHREADSTATE_RUNNING);
    635635    rc = pThread->pfnThread(pThread, pThread->pvUser);
     636
     637    /*
     638     * Paranoia checks for leftover resources.
     639     */
     640#ifdef RTSEMRW_STRICT
     641    int32_t cWrite = ASMAtomicReadS32(&pThread->cWriteLocks);
     642    Assert(!cWrite);
     643    int32_t cRead = ASMAtomicReadS32(&pThread->cReadLocks);
     644    Assert(!cRead);
     645#endif
    636646
    637647    Log(("rtThreadMain: Terminating: rc=%d pThread=%p NativeThread=%RTnthrd Name=%s pfnThread=%p pvUser=%p\n",
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