VirtualBox

Ignore:
Timestamp:
Jan 11, 2010 10:46:24 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56447
Message:

iprt: SemRW lock order bugfixes.

File:
1 edited

Legend:

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

    r25707 r25710  
    30463046        return VINF_SUCCESS;
    30473047    AssertReturn(pRecU->Excl.hThread != NIL_RTTHREAD, VERR_SEM_LV_INVALID_PARAMETER);
     3048    Assert(pRecU->Excl.hThread == RTThreadSelf());
    30483049    AssertReturn(pRecU->Excl.cRecursion > 1, VERR_SEM_LV_INVALID_PARAMETER);
    30493050
     3051    /*
     3052     * Check the release order.
     3053     */
     3054    if (   pRecU->Excl.hClass != NIL_RTLOCKVALCLASS
     3055        && pRecU->Excl.hClass->fStrictReleaseOrder
     3056        && pRecU->Excl.hClass->cMsMinOrder != RT_INDEFINITE_WAIT
     3057       )
     3058    {
     3059        int rc = rtLockValidatorStackCheckReleaseOrder(pRecU->Excl.hThread, pRecU);
     3060        if (RT_FAILURE(rc))
     3061            return rc;
     3062    }
     3063
     3064    /*
     3065     * Perform the unwind.
     3066     */
    30503067    pRecU->Excl.cRecursion--;
    30513068    rtLockValidatorStackPopRecursion(pRecU->Excl.hThread, pRecU);
     
    30643081    if (!pRecU->Excl.fEnabled)
    30653082        return VINF_SUCCESS;
     3083    Assert(pRecU->Excl.hThread == RTThreadSelf());
    30663084    AssertReturn(pRecU->Excl.hThread != NIL_RTTHREAD, VERR_SEM_LV_INVALID_PARAMETER);
    30673085    AssertReturn(pRecU->Excl.cRecursion > 0, VERR_SEM_LV_INVALID_PARAMETER);
     
    30943112    if (!pRecU->Excl.fEnabled)
    30953113        return VINF_SUCCESS;
     3114    Assert(pRecU->Excl.hThread == RTThreadSelf());
    30963115    AssertReturn(pRecU->Excl.hThread != NIL_RTTHREAD, VERR_SEM_LV_INVALID_PARAMETER);
    30973116    AssertReturn(pRecU->Excl.cRecursion > 1, VERR_SEM_LV_INVALID_PARAMETER);
    30983117
     3118    /*
     3119     * Check the release order.
     3120     */
     3121    if (   pRecU->Excl.hClass != NIL_RTLOCKVALCLASS
     3122        && pRecU->Excl.hClass->fStrictReleaseOrder
     3123        && pRecU->Excl.hClass->cMsMinOrder != RT_INDEFINITE_WAIT
     3124       )
     3125    {
     3126        int rc = rtLockValidatorStackCheckReleaseOrder(pRecU->Excl.hThread, pRecU);
     3127        if (RT_FAILURE(rc))
     3128            return rc;
     3129    }
     3130
     3131    /*
     3132     * Perform the unwind.
     3133     */
    30993134    pRecU->Excl.cRecursion--;
    31003135    rtLockValidatorStackPopRecursion(pRecU->Excl.hThread, pRecU);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette