VirtualBox

Changeset 25409 in vbox


Ignore:
Timestamp:
Dec 15, 2009 3:04:41 PM (15 years ago)
Author:
vboxsync
Message:

IPRT,PDMCritSect,Main: Moved code dealing with lock counting from RTThread to RTLockValidator. Fixed thread termination assertion on windows.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/lockvalidator.h

    r25406 r25409  
    240240RTDECL(RTTHREAD) RTLockValidatorUnsetOwner(PRTLOCKVALIDATORREC pRec);
    241241
     242/**
     243 * Gets the number of write locks and critical sections the specified
     244 * thread owns.
     245 *
     246 * This number does not include any nested lock/critect entries.
     247 *
     248 * Note that it probably will return 0 for non-strict builds since
     249 * release builds doesn't do unnecessary diagnostic counting like this.
     250 *
     251 * @returns Number of locks on success (0+) and VERR_INVALID_HANDLER on failure
     252 * @param   Thread          The thread we're inquiring about.
     253 * @remarks Will only work for strict builds.
     254 */
     255RTDECL(int32_t) RTLockValidatorWriteLockGetCount(RTTHREAD Thread);
     256
     257/**
     258 * Works the THREADINT::cWriteLocks member, mostly internal.
     259 *
     260 * @param   Thread      The current thread.
     261 */
     262RTDECL(void) RTLockValidatorWriteLockInc(RTTHREAD Thread);
     263
     264/**
     265 * Works the THREADINT::cWriteLocks member, mostly internal.
     266 *
     267 * @param   Thread      The current thread.
     268 */
     269RTDECL(void) RTLockValidatorWriteLockDec(RTTHREAD Thread);
     270
     271/**
     272 * Gets the number of read locks the specified thread owns.
     273 *
     274 * Note that nesting read lock entry will be included in the
     275 * total sum. And that it probably will return 0 for non-strict
     276 * builds since release builds doesn't do unnecessary diagnostic
     277 * counting like this.
     278 *
     279 * @returns Number of read locks on success (0+) and VERR_INVALID_HANDLER on failure
     280 * @param   Thread          The thread we're inquiring about.
     281 */
     282RTDECL(int32_t) RTLockValidatorReadLockGetCount(RTTHREAD Thread);
     283
     284/**
     285 * Works the THREADINT::cReadLocks member.
     286 *
     287 * @param   Thread      The current thread.
     288 */
     289RTDECL(void) RTLockValidatorReadLockInc(RTTHREAD Thread);
     290
     291/**
     292 * Works the THREADINT::cReadLocks member.
     293 *
     294 * @param   Thread      The current thread.
     295 */
     296RTDECL(void) RTLockValidatorReadLockDec(RTTHREAD Thread);
     297
     298
    242299
    243300/*RTDECL(int) RTLockValidatorClassCreate();*/
  • trunk/include/iprt/thread.h

    r25406 r25409  
    574574
    575575/**
    576  * Gets the number of write locks and critical sections the specified
    577  * thread owns.
    578  *
    579  * This number does not include any nested lock/critect entries.
    580  *
    581  * Note that it probably will return 0 for non-strict builds since
    582  * release builds doesn't do unnecessary diagnostic counting like this.
    583  *
    584  * @returns Number of locks on success (0+) and VERR_INVALID_HANDLER on failure
    585  * @param   Thread          The thread we're inquiring about.
    586  * @remarks Will only work for strict builds.
    587  */
    588 RTDECL(int32_t) RTThreadGetWriteLockCount(RTTHREAD Thread);
    589 
    590 /**
    591  * Works the THREADINT::cWriteLocks member, mostly internal.
    592  *
    593  * @param   Thread      The current thread.
    594  */
    595 RTDECL(void) RTThreadWriteLockInc(RTTHREAD Thread);
    596 
    597 /**
    598  * Works the THREADINT::cWriteLocks member, mostly internal.
    599  *
    600  * @param   Thread      The current thread.
    601  */
    602 RTDECL(void) RTThreadWriteLockDec(RTTHREAD Thread);
    603 
    604 /**
    605  * Gets the number of read locks the specified thread owns.
    606  *
    607  * Note that nesting read lock entry will be included in the
    608  * total sum. And that it probably will return 0 for non-strict
    609  * builds since release builds doesn't do unnecessary diagnostic
    610  * counting like this.
    611  *
    612  * @returns Number of read locks on success (0+) and VERR_INVALID_HANDLER on failure
    613  * @param   Thread          The thread we're inquiring about.
    614  */
    615 RTDECL(int32_t) RTThreadGetReadLockCount(RTTHREAD Thread);
    616 
    617 /**
    618  * Works the THREADINT::cReadLocks member.
    619  *
    620  * @param   Thread      The current thread.
    621  */
    622 RTDECL(void) RTThreadReadLockInc(RTTHREAD Thread);
    623 
    624 /**
    625  * Works the THREADINT::cReadLocks member.
    626  *
    627  * @param   Thread      The current thread.
    628  */
    629 RTDECL(void) RTThreadReadLockDec(RTTHREAD Thread);
    630 
    631 /**
    632576 * Unblocks a thread.
    633577 *
  • trunk/src/VBox/Main/MachineImpl.cpp

    r25357 r25409  
    6060#include <stdlib.h>
    6161
     62#include <iprt/asm.h>
    6263#include <iprt/path.h>
    6364#include <iprt/dir.h>
    64 #include <iprt/asm.h>
     65#include <iprt/env.h>
     66#include <iprt/lockvalidator.h>
    6567#include <iprt/process.h>
    6668#include <iprt/cpp/utils.h>
    67 #include <iprt/env.h>
    6869#include <iprt/string.h>
    6970
     
    97529753
    97539754    /* No locks should be held at this point. */
    9754     AssertMsg (RTThreadGetWriteLockCount (RTThreadSelf()) == 0, ("%d\n", RTThreadGetWriteLockCount (RTThreadSelf())));
    9755     AssertMsg (RTThreadGetReadLockCount (RTThreadSelf()) == 0, ("%d\n", RTThreadGetReadLockCount (RTThreadSelf())));
     9755    AssertMsg (RTLockValidatorWriteLockGetCount (RTThreadSelf()) == 0, ("%d\n", RTLockValidatorWriteLockGetCount (RTThreadSelf())));
     9756    AssertMsg (RTLockValidatorReadLockGetCount (RTThreadSelf()) == 0, ("%d\n", RTLockValidatorReadLockGetCount (RTThreadSelf())));
    97569757
    97579758    return directControl->OnUSBDeviceAttach (aDevice, aError, aMaskedIfs);
     
    97849785
    97859786    /* No locks should be held at this point. */
    9786     AssertMsg (RTThreadGetWriteLockCount (RTThreadSelf()) == 0, ("%d\n", RTThreadGetWriteLockCount (RTThreadSelf())));
    9787     AssertMsg (RTThreadGetReadLockCount (RTThreadSelf()) == 0, ("%d\n", RTThreadGetReadLockCount (RTThreadSelf())));
     9787    AssertMsg (RTLockValidatorWriteLockGetCount (RTThreadSelf()) == 0, ("%d\n", RTLockValidatorWriteLockGetCount (RTThreadSelf())));
     9788    AssertMsg (RTLockValidatorReadLockGetCount (RTThreadSelf()) == 0, ("%d\n", RTLockValidatorReadLockGetCount (RTThreadSelf())));
    97889789
    97899790    return directControl->OnUSBDeviceDetach (aId, aError);
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r24987 r25409  
    4646# include <iprt/env.h>
    4747# include <iprt/file.h>
     48# include <iprt/lockvalidator.h>
    4849# include <iprt/path.h>
    4950#endif
     
    412413                    if (Thread != NIL_RTTHREAD)
    413414                    {
    414                         int32_t c = RTThreadGetWriteLockCount(Thread);
     415                        int32_t c = RTLockValidatorWriteLockGetCount(Thread);
    415416                        RTSemSpinMutexRequest(pLogger->hSpinMtx);
    416                         c = RTThreadGetWriteLockCount(Thread) - c;
     417                        c = RTLockValidatorWriteLockGetCount(Thread) - c;
    417418                        RTSemSpinMutexRelease(pLogger->hSpinMtx);
    418419                        ASMAtomicWriteU32(&g_cLoggerLockCount, c);
     
    25252526                    if (Thread != NIL_RTTHREAD)
    25262527                    {
    2527                         uint32_t cReadLocks  = RTThreadGetReadLockCount(Thread);
    2528                         uint32_t cWriteLocks = RTThreadGetWriteLockCount(Thread) - g_cLoggerLockCount;
     2528                        uint32_t cReadLocks  = RTLockValidatorReadLockGetCount(Thread);
     2529                        uint32_t cWriteLocks = RTLockValidatorWriteLockGetCount(Thread) - g_cLoggerLockCount;
    25292530                        cReadLocks  = RT_MIN(0xfff, cReadLocks);
    25302531                        cWriteLocks = RT_MIN(0xfff, cWriteLocks);
  • trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp

    r25406 r25409  
    185185    return hThread;
    186186}
     187
     188
     189RTDECL(int32_t) RTLockValidatorWriteLockGetCount(RTTHREAD Thread)
     190{
     191    if (Thread == NIL_RTTHREAD)
     192        return 0;
     193
     194    PRTTHREADINT pThread = rtThreadGet(Thread);
     195    if (!pThread)
     196        return VERR_INVALID_HANDLE;
     197    int32_t cWriteLocks = ASMAtomicReadS32(&pThread->LockValidator.cWriteLocks);
     198    rtThreadRelease(pThread);
     199    return cWriteLocks;
     200}
     201RT_EXPORT_SYMBOL(RTLockValidatorWriteLockGetCount);
     202
     203
     204RTDECL(void) RTLockValidatorWriteLockInc(RTTHREAD Thread)
     205{
     206    PRTTHREADINT pThread = rtThreadGet(Thread);
     207    AssertReturnVoid(pThread);
     208    ASMAtomicIncS32(&pThread->LockValidator.cWriteLocks);
     209    rtThreadRelease(pThread);
     210}
     211RT_EXPORT_SYMBOL(RTLockValidatorWriteLockInc);
     212
     213
     214RTDECL(void) RTLockValidatorWriteLockDec(RTTHREAD Thread)
     215{
     216    PRTTHREADINT pThread = rtThreadGet(Thread);
     217    AssertReturnVoid(pThread);
     218    ASMAtomicDecS32(&pThread->LockValidator.cWriteLocks);
     219    rtThreadRelease(pThread);
     220}
     221RT_EXPORT_SYMBOL(RTLockValidatorWriteLockDec);
     222
     223
     224RTDECL(int32_t) RTLockValidatorReadLockGetCount(RTTHREAD Thread)
     225{
     226    if (Thread == NIL_RTTHREAD)
     227        return 0;
     228
     229    PRTTHREADINT pThread = rtThreadGet(Thread);
     230    if (!pThread)
     231        return VERR_INVALID_HANDLE;
     232    int32_t cReadLocks = ASMAtomicReadS32(&pThread->LockValidator.cReadLocks);
     233    rtThreadRelease(pThread);
     234    return cReadLocks;
     235}
     236RT_EXPORT_SYMBOL(RTLockValidatorReadLockGetCount);
     237
     238
     239RTDECL(void) RTLockValidatorReadLockInc(RTTHREAD Thread)
     240{
     241    PRTTHREADINT pThread = rtThreadGet(Thread);
     242    Assert(pThread);
     243    ASMAtomicIncS32(&pThread->LockValidator.cReadLocks);
     244    rtThreadRelease(pThread);
     245}
     246RT_EXPORT_SYMBOL(RTLockValidatorReadLockInc);
     247
     248
     249RTDECL(void) RTLockValidatorReadLockDec(RTTHREAD Thread)
     250{
     251    PRTTHREADINT pThread = rtThreadGet(Thread);
     252    Assert(pThread);
     253    ASMAtomicDecS32(&pThread->LockValidator.cReadLocks);
     254    rtThreadRelease(pThread);
     255}
     256RT_EXPORT_SYMBOL(RTLockValidatorReadLockDec);
     257
    187258
    188259
     
    308379    AssertPtrReturnVoid(pThread);
    309380    AssertReturnVoid(pThread->u32Magic == RTTHREADINT_MAGIC);
    310     AssertReturnVoid(rtThreadGetState(pThread) == RTTHREADSTATE_RUNNING);
     381    RTTHREADSTATE enmThreadState = rtThreadGetState(pThread);
     382    AssertReturnVoid(   enmThreadState == RTTHREADSTATE_RUNNING
     383                     || enmThreadState == RTTHREADSTATE_TERMINATED /* rtThreadRemove uses locks too */);
    311384
    312385    /*
  • trunk/src/VBox/Runtime/common/misc/thread.cpp

    r25406 r25409  
    12031203RT_EXPORT_SYMBOL(RTThreadGetType);
    12041204
    1205 
    12061205#ifdef IN_RING3
    1207 
    1208 /**
    1209  * Gets the number of write locks and critical sections the specified
    1210  * thread owns.
    1211  *
    1212  * This number does not include any nested lock/critect entries.
    1213  *
    1214  * Note that it probably will return 0 for non-strict builds since
    1215  * release builds doesn't do unnecessary diagnostic counting like this.
    1216  *
    1217  * @returns Number of locks on success (0+) and VERR_INVALID_HANDLER on failure
    1218  * @param   Thread          The thread we're inquiring about.
    1219  *
    1220  * @todo Move this.
    1221  */
    1222 RTDECL(int32_t) RTThreadGetWriteLockCount(RTTHREAD Thread)
    1223 {
    1224     if (Thread == NIL_RTTHREAD)
    1225         return 0;
    1226 
    1227     PRTTHREADINT pThread = rtThreadGet(Thread);
    1228     if (!pThread)
    1229         return VERR_INVALID_HANDLE;
    1230     int32_t cWriteLocks = ASMAtomicReadS32(&pThread->LockValidator.cWriteLocks);
    1231     rtThreadRelease(pThread);
    1232     return cWriteLocks;
    1233 }
    1234 RT_EXPORT_SYMBOL(RTThreadGetWriteLockCount);
    1235 
    1236 
    1237 /**
    1238  * Works the THREADINT::cWriteLocks member, mostly internal.
    1239  *
    1240  * @param   Thread      The current thread.
    1241  *
    1242  * @todo Move this.
    1243  */
    1244 RTDECL(void) RTThreadWriteLockInc(RTTHREAD Thread)
    1245 {
    1246     PRTTHREADINT pThread = rtThreadGet(Thread);
    1247     AssertReturnVoid(pThread);
    1248     ASMAtomicIncS32(&pThread->LockValidator.cWriteLocks);
    1249     rtThreadRelease(pThread);
    1250 }
    1251 RT_EXPORT_SYMBOL(RTThreadWriteLockInc);
    1252 
    1253 
    1254 /**
    1255  * Works the THREADINT::cWriteLocks member, mostly internal.
    1256  *
    1257  * @param   Thread      The current thread.
    1258  *
    1259  * @todo Move this.
    1260  */
    1261 RTDECL(void) RTThreadWriteLockDec(RTTHREAD Thread)
    1262 {
    1263     PRTTHREADINT pThread = rtThreadGet(Thread);
    1264     AssertReturnVoid(pThread);
    1265     ASMAtomicDecS32(&pThread->LockValidator.cWriteLocks);
    1266     rtThreadRelease(pThread);
    1267 }
    1268 RT_EXPORT_SYMBOL(RTThreadWriteLockDec);
    1269 
    1270 
    1271 /**
    1272  * Gets the number of read locks the specified thread owns.
    1273  *
    1274  * Note that nesting read lock entry will be included in the
    1275  * total sum. And that it probably will return 0 for non-strict
    1276  * builds since release builds doesn't do unnecessary diagnostic
    1277  * counting like this.
    1278  *
    1279  * @returns Number of read locks on success (0+) and VERR_INVALID_HANDLER on failure
    1280  * @param   Thread          The thread we're inquiring about.
    1281  *
    1282  * @todo Move this.
    1283  */
    1284 RTDECL(int32_t) RTThreadGetReadLockCount(RTTHREAD Thread)
    1285 {
    1286     if (Thread == NIL_RTTHREAD)
    1287         return 0;
    1288 
    1289     PRTTHREADINT pThread = rtThreadGet(Thread);
    1290     if (!pThread)
    1291         return VERR_INVALID_HANDLE;
    1292     int32_t cReadLocks = ASMAtomicReadS32(&pThread->LockValidator.cReadLocks);
    1293     rtThreadRelease(pThread);
    1294     return cReadLocks;
    1295 }
    1296 RT_EXPORT_SYMBOL(RTThreadGetReadLockCount);
    1297 
    1298 
    1299 /**
    1300  * Works the THREADINT::cReadLocks member.
    1301  *
    1302  * @param   Thread      The current thread.
    1303  *
    1304  * @todo Move this.
    1305  */
    1306 RTDECL(void) RTThreadReadLockInc(RTTHREAD Thread)
    1307 {
    1308     PRTTHREADINT pThread = rtThreadGet(Thread);
    1309     Assert(pThread);
    1310     ASMAtomicIncS32(&pThread->LockValidator.cReadLocks);
    1311     rtThreadRelease(pThread);
    1312 }
    1313 RT_EXPORT_SYMBOL(RTThreadReadLockInc);
    1314 
    1315 
    1316 /**
    1317  * Works the THREADINT::cReadLocks member.
    1318  *
    1319  * @param   Thread      The current thread.
    1320  *
    1321  * @todo Move this.
    1322  */
    1323 RTDECL(void) RTThreadReadLockDec(RTTHREAD Thread)
    1324 {
    1325     PRTTHREADINT pThread = rtThreadGet(Thread);
    1326     Assert(pThread);
    1327     ASMAtomicDecS32(&pThread->LockValidator.cReadLocks);
    1328     rtThreadRelease(pThread);
    1329 }
    1330 RT_EXPORT_SYMBOL(RTThreadReadLockDec);
    1331 
    1332 
    1333 
    1334 
    13351206
    13361207/**
  • trunk/src/VBox/Runtime/generic/critsect-generic.cpp

    r25398 r25409  
    244244    ASMAtomicWriteHandle(&pCritSect->NativeThreadOwner, NativeThreadSelf);
    245245#ifdef RTCRITSECT_STRICT
    246     RTThreadWriteLockInc(RTLockValidatorSetOwner(pCritSect->pValidatorRec, ThreadSelf, uId, RT_SRC_POS_ARGS));
     246    RTLockValidatorWriteLockInc(RTLockValidatorSetOwner(pCritSect->pValidatorRec, ThreadSelf, uId, RT_SRC_POS_ARGS));
    247247#endif
    248248
     
    339339    ASMAtomicWriteHandle(&pCritSect->NativeThreadOwner, NativeThreadSelf);
    340340#ifdef RTCRITSECT_STRICT
    341     RTThreadWriteLockInc(RTLockValidatorSetOwner(pCritSect->pValidatorRec, hThreadSelf, uId, RT_SRC_POS_ARGS));
     341    RTLockValidatorWriteLockInc(RTLockValidatorSetOwner(pCritSect->pValidatorRec, hThreadSelf, uId, RT_SRC_POS_ARGS));
    342342#endif
    343343
     
    392392         */
    393393#ifdef RTCRITSECT_STRICT
    394         RTThreadWriteLockInc(RTLockValidatorUnsetOwner(pCritSect->pValidatorRec));
     394        RTLockValidatorWriteLockInc(RTLockValidatorUnsetOwner(pCritSect->pValidatorRec));
    395395#endif
    396396        ASMAtomicWriteHandle(&pCritSect->NativeThreadOwner, NIL_RTNATIVETHREAD);
  • trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp

    r25398 r25409  
    289289    ASMAtomicWriteU32(&pThis->cNesting, 1);
    290290#ifdef RTSEMMUTEX_STRICT
    291     RTThreadWriteLockInc(RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, RTSEMMUTEX_STRICT_POS_ARGS));
     291    RTLockValidatorWriteLockInc(RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, RTSEMMUTEX_STRICT_POS_ARGS));
    292292#endif
    293293    return VINF_SUCCESS;
     
    373373     */
    374374#ifdef RTSEMMUTEX_STRICT
    375     RTThreadWriteLockDec(RTLockValidatorUnsetOwner(&pThis->ValidatorRec));
     375    RTLockValidatorWriteLockDec(RTLockValidatorUnsetOwner(&pThis->ValidatorRec));
    376376#endif
    377377    pThis->Owner = (pthread_t)~0;
  • trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp

    r25398 r25409  
    238238    ASMAtomicWriteU32(&pThis->cNesting, 1);
    239239#ifdef RTSEMMUTEX_STRICT
    240     RTThreadWriteLockInc(RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, RTSEMMUTEX_STRICT_POS_ARGS));
     240    RTLockValidatorWriteLockInc(RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, RTSEMMUTEX_STRICT_POS_ARGS));
    241241#endif
    242242
     
    321321     */
    322322#ifdef RTSEMMUTEX_STRICT
    323     RTThreadWriteLockDec(RTLockValidatorUnsetOwner(&pThis->ValidatorRec));
     323    RTLockValidatorWriteLockDec(RTLockValidatorUnsetOwner(&pThis->ValidatorRec));
    324324#endif
    325325    pThis->Owner = (pthread_t)-1;
  • trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp

    r8653 r25409  
    3333*******************************************************************************/
    3434#include <iprt/semaphore.h>
     35#include "internal/iprt.h"
     36
     37#include <iprt/asm.h>
    3538#include <iprt/assert.h>
    36 #include <iprt/alloc.h>
     39#include <iprt/err.h>
     40#include <iprt/lockvalidator.h>
     41#include <iprt/mem.h>
    3742#include <iprt/thread.h>
    38 #include <iprt/asm.h>
    39 #include <iprt/err.h>
    4043
    4144#include <errno.h>
     
    185188#ifdef RTSEMRW_STRICT
    186189        if (ThreadSelf != NIL_RTTHREAD)
    187             RTThreadReadLockInc(ThreadSelf);
     190            RTLockValidatorReadLockInc(ThreadSelf);
    188191#endif
    189192        return VINF_SUCCESS;
     
    238241#ifdef RTSEMRW_STRICT
    239242    if (ThreadSelf != NIL_RTTHREAD)
    240         RTThreadReadLockInc(ThreadSelf);
     243        RTLockValidatorReadLockInc(ThreadSelf);
    241244#endif
    242245    return VINF_SUCCESS;
     
    278281#ifdef RTSEMRW_STRICT
    279282        if (ThreadSelf != NIL_RTTHREAD)
    280             RTThreadReadLockDec(ThreadSelf);
     283            RTLockValidatorReadLockDec(ThreadSelf);
    281284#endif
    282285        return VINF_SUCCESS;
     
    295298#ifdef RTSEMRW_STRICT
    296299    if (ThreadSelf != NIL_RTTHREAD)
    297         RTThreadReadLockDec(ThreadSelf);
     300        RTLockValidatorReadLockDec(ThreadSelf);
    298301#endif
    299302    return VINF_SUCCESS;
     
    375378    RTTHREAD ThreadSelf = RTThreadSelf();
    376379    if (ThreadSelf != NIL_RTTHREAD)
    377         RTThreadWriteLockInc(ThreadSelf);
     380        RTLockValidatorWriteLockInc(ThreadSelf);
    378381#endif
    379382    return VINF_SUCCESS;
     
    425428    RTTHREAD ThreadSelf = RTThreadSelf();
    426429    if (ThreadSelf != NIL_RTTHREAD)
    427         RTThreadWriteLockDec(ThreadSelf);
     430        RTLockValidatorWriteLockDec(ThreadSelf);
    428431#endif
    429432    return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/r3/win/semmutex-win.cpp

    r25398 r25409  
    171171        case WAIT_OBJECT_0:
    172172#ifdef RTSEMMUTEX_STRICT
    173             RTThreadWriteLockInc(RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, RTSEMMUTEX_STRICT_POS_ARGS));
     173            RTLockValidatorWriteLockInc(RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, RTSEMMUTEX_STRICT_POS_ARGS));
    174174#endif
    175175            return VINF_SUCCESS;
     
    227227    if (   pThis->ValidatorRec.hThread != NIL_RTTHREAD
    228228        && pThis->ValidatorRec.hThread == RTThreadSelf())
    229         RTThreadWriteLockDec(RTLockValidatorUnsetOwner(&pThis->ValidatorRec));
     229        RTLockValidatorWriteLockDec(RTLockValidatorUnsetOwner(&pThis->ValidatorRec));
    230230    else
    231231        AssertMsgFailed(("%p hThread=%RTthrd\n", pThis, pThis->ValidatorRec.hThread));
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r25406 r25409  
    109109
    110110# ifdef PDMCRITSECT_STRICT
    111     RTThreadWriteLockInc(RTLockValidatorSetOwner(pCritSect->s.Core.pValidatorRec, NIL_RTTHREAD, PDMCRITSECT_STRICT_POS_ARGS));
     111    RTLockValidatorWriteLockInc(RTLockValidatorSetOwner(pCritSect->s.Core.pValidatorRec, NIL_RTTHREAD, PDMCRITSECT_STRICT_POS_ARGS));
    112112# endif
    113113
     
    403403        &&  pCritSect->s.Core.pValidatorRec
    404404        &&  pCritSect->s.Core.pValidatorRec->hThread != NIL_RTTHREAD)
    405         RTThreadWriteLockDec(RTLockValidatorUnsetOwner(pCritSect->s.Core.pValidatorRec));
     405        RTLockValidatorWriteLockDec(RTLockValidatorUnsetOwner(pCritSect->s.Core.pValidatorRec));
    406406    return rc;
    407407}
     
    449449#  if defined(PDMCRITSECT_STRICT)
    450450        if (pCritSect->s.Core.pValidatorRec->hThread != NIL_RTTHREAD)
    451             RTThreadWriteLockDec(RTLockValidatorUnsetOwner(pCritSect->s.Core.pValidatorRec));
     451            RTLockValidatorWriteLockDec(RTLockValidatorUnsetOwner(pCritSect->s.Core.pValidatorRec));
    452452#  endif
    453453        Assert(!pCritSect->s.Core.pValidatorRec || pCritSect->s.Core.pValidatorRec->hThread == NIL_RTTHREAD);
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r23019 r25409  
    12641264    { "RTThreadSelf",                           (void *)(uintptr_t)&RTThreadSelf,                   NULL,                                       0,                                                     REMFNDESC_FLAGS_RET_INT,    sizeof(RTTHREAD),    NULL },
    12651265    { "RTThreadNativeSelf",                     (void *)(uintptr_t)&RTThreadNativeSelf,             NULL,                                       0,                                                     REMFNDESC_FLAGS_RET_INT, sizeof(RTNATIVETHREAD), NULL },
    1266     { "RTThreadGetWriteLockCount",              (void *)(uintptr_t)&RTThreadGetWriteLockCount,      &g_aArgsThread[0],                          0,                                                     REMFNDESC_FLAGS_RET_INT,    sizeof(int32_t),     NULL },
     1266    { "RTLockValidatorWriteLockGetCount",       (void *)(uintptr_t)&RTLockValidatorWriteLockGetCount, &g_aArgsThread[0],                        0,                                                     REMFNDESC_FLAGS_RET_INT,    sizeof(int32_t),     NULL },
    12671267};
    12681268
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