VirtualBox

Changeset 25607 in vbox


Ignore:
Timestamp:
Dec 31, 2009 1:21:39 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56298
Message:

iprt,pdmcritsect: Shortening and cleaning up the lock validator structure names.

Location:
trunk
Files:
13 edited

Legend:

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

    r25406 r25607  
    8787    RTSEMEVENT                          EventSem;
    8888    /** Lock validator record.  Only used in strict builds. */
    89     R3R0PTRTYPE(PRTLOCKVALIDATORREC)    pValidatorRec;
     89    R3R0PTRTYPE(PRTLOCKVALRECEXCL)      pValidatorRec;
    9090    /** Alignmnet padding. */
    9191    RTHCPTR                             Alignment;
  • trunk/include/iprt/lockvalidator.h

    r25602 r25607  
    4646/** Pointer to a record union.
    4747 * @internal  */
    48 typedef union RTLOCKVALIDATORRECUNION *PRTLOCKVALIDATORRECUNION;
     48typedef union RTLOCKVALRECUNION *PRTLOCKVALRECUNION;
    4949
    5050/**
    5151 * Source position.
    5252 */
    53 typedef struct RTLOCKVALIDATORSRCPOS
     53typedef struct RTLOCKVALSRCPOS
    5454{
    5555    /** The file where the lock was taken. */
     
    6464    uint32_t                            u32Padding; /**< Alignment padding. */
    6565#endif
    66 } RTLOCKVALIDATORSRCPOS;
    67 AssertCompileSize(RTLOCKVALIDATORSRCPOS, HC_ARCH_BITS == 32 ? 16 : 32);
     66} RTLOCKVALSRCPOS;
     67AssertCompileSize(RTLOCKVALSRCPOS, HC_ARCH_BITS == 32 ? 16 : 32);
    6868/* The pointer types are defined in iprt/types.h. */
    6969
    70 /** @def RTLOCKVALIDATORSRCPOS_INIT
    71  * Initializer for a RTLOCKVALIDATORSRCPOS variable.
     70/** @def RTLOCKVALSRCPOS_INIT
     71 * Initializer for a RTLOCKVALSRCPOS variable.
    7272 *
    7373 * @param   pszFile         The file name.  Optional (NULL).
     
    7878 */
    7979#if HC_ARCH_BITS == 64
    80 # define RTLOCKVALIDATORSRCPOS_INIT(pszFile, uLine, pszFunction, uId) \
     80# define RTLOCKVALSRCPOS_INIT(pszFile, uLine, pszFunction, uId) \
    8181    { (pszFile), (pszFunction), (uId), (uLine), 0 }
    8282#else
    83 # define RTLOCKVALIDATORSRCPOS_INIT(pszFile, uLine, pszFunction, uId) \
     83# define RTLOCKVALSRCPOS_INIT(pszFile, uLine, pszFunction, uId) \
    8484    { (pszFile), (pszFunction), (uId), (uLine) }
    8585#endif
    8686
    87 /** @def RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API
    88  * Initializer for a RTLOCKVALIDATORSRCPOS variable in a typicial debug API
     87/** @def RTLOCKVALSRCPOS_INIT_DEBUG_API
     88 * Initializer for a RTLOCKVALSRCPOS variable in a typicial debug API
    8989 * variant.  Assumes RT_SRC_POS_DECL and RTHCUINTPTR uId as arguments.
    9090 */
    91 #define RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API()  \
    92     RTLOCKVALIDATORSRCPOS_INIT(pszFile, iLine, pszFunction, uId)
    93 
    94 /** @def RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API
    95  * Initializer for a RTLOCKVALIDATORSRCPOS variable in a normal API
     91#define RTLOCKVALSRCPOS_INIT_DEBUG_API()  \
     92    RTLOCKVALSRCPOS_INIT(pszFile, iLine, pszFunction, uId)
     93
     94/** @def RTLOCKVALSRCPOS_INIT_NORMAL_API
     95 * Initializer for a RTLOCKVALSRCPOS variable in a normal API
    9696 * variant.  Assumes iprt/asm.h is included.
    9797 */
    98 #define RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API() \
    99     RTLOCKVALIDATORSRCPOS_INIT(__FILE__, __LINE__, __PRETTY_FUNCTION__, (uintptr_t)ASMReturnAddress())
     98#define RTLOCKVALSRCPOS_INIT_NORMAL_API() \
     99    RTLOCKVALSRCPOS_INIT(__FILE__, __LINE__, __PRETTY_FUNCTION__, (uintptr_t)ASMReturnAddress())
    100100
    101101/** Pointer to a record of one ownership share.  */
    102 typedef struct RTLOCKVALIDATORSHARED *PRTLOCKVALIDATORSHARED;
     102typedef struct RTLOCKVALRECSHRD *PRTLOCKVALRECSHRD;
    103103
    104104
     
    110110    /** The magic value indicating the record type. */
    111111    uint32_t                            u32Magic;
    112 } RTLOCKVALIDATORRECCORE;
     112} RTLOCKVALRECCORE;
    113113/** Pointer to a lock validator record core. */
    114 typedef RTLOCKVALIDATORRECCORE *PRTLOCKVALIDATORRECCORE;
     114typedef RTLOCKVALRECCORE *PRTLOCKVALRECCORE;
    115115/** Pointer to a const lock validator record core. */
    116 typedef RTLOCKVALIDATORRECCORE const *PCRTLOCKVALIDATORRECCORE;
    117 
    118 
    119 /**
    120  * Record recording the ownership of a lock.
     116typedef RTLOCKVALRECCORE const *PCRTLOCKVALRECCORE;
     117
     118
     119/**
     120 * Record recording the exclusive ownership of a lock.
    121121 *
    122122 * This is typically part of the per-lock data structure when compiling with
    123123 * the lock validator.
    124124 */
    125 typedef struct RTLOCKVALIDATORREC
     125typedef struct RTLOCKVALRECEXCL
    126126{
    127     /** Record core with RTLOCKVALIDATORREC_MAGIC as the magic value. */
    128     RTLOCKVALIDATORRECCORE              Core;
     127    /** Record core with RTLOCKVALRECEXCL_MAGIC as the magic value. */
     128    RTLOCKVALRECCORE                    Core;
    129129    /** Whether it's enabled or not. */
    130130    bool                                fEnabled;
     
    132132    bool                                afReserved[3];
    133133    /** Source position where the lock was taken. */
    134     RTLOCKVALIDATORSRCPOS               SrcPos;
     134    RTLOCKVALSRCPOS                     SrcPos;
    135135    /** The current owner thread. */
    136136    RTTHREAD volatile                   hThread;
    137137    /** Pointer to the lock record below us. Only accessed by the owner. */
    138     R3R0PTRTYPE(PRTLOCKVALIDATORREC)    pDown;
     138    R3R0PTRTYPE(PRTLOCKVALRECUNION)     pDown;
    139139    /** Recursion count */
    140140    uint32_t                            cRecursion;
     
    149149    /** Pointer to the next sibling record.
    150150     * This is used to find the read side of a read-write lock.  */
    151     R3R0PTRTYPE(PRTLOCKVALIDATORRECUNION) pSibling;
    152 } RTLOCKVALIDATORREC;
    153 AssertCompileSize(RTLOCKVALIDATORREC, HC_ARCH_BITS == 32 ? 8 + 16 + 32 : 8 + 32 + 56);
     151    R3R0PTRTYPE(PRTLOCKVALRECUNION) pSibling;
     152} RTLOCKVALRECEXCL;
     153AssertCompileSize(RTLOCKVALRECEXCL, HC_ARCH_BITS == 32 ? 8 + 16 + 32 : 8 + 32 + 56);
    154154/* The pointer type is defined in iprt/types.h. */
    155155
     
    157157 * For recording the one ownership share.
    158158 */
    159 typedef struct RTLOCKVALIDATORSHAREDONE
     159typedef struct RTLOCKVALRECSHRDOWN
    160160{
    161     /** Record core with RTLOCKVALIDATORSHAREDONE_MAGIC as the magic value. */
    162     RTLOCKVALIDATORRECCORE              Core;
     161    /** Record core with RTLOCKVALRECSHRDOWN_MAGIC as the magic value. */
     162    RTLOCKVALRECCORE                    Core;
    163163    /** Recursion count */
    164164    uint32_t                            cRecursion;
     
    166166    RTTHREAD volatile                   hThread;
    167167    /** Pointer to the lock record below us. Only accessed by the owner. */
    168     R3R0PTRTYPE(PRTLOCKVALIDATORREC)    pDown;
     168    R3R0PTRTYPE(PRTLOCKVALRECUNION)     pDown;
    169169    /** Pointer back to the shared record. */
    170     R3R0PTRTYPE(PRTLOCKVALIDATORSHARED) pSharedRec;
     170    R3R0PTRTYPE(PRTLOCKVALRECSHRD)      pSharedRec;
    171171#if HC_ARCH_BITS == 32
    172172    /** Reserved. */
     
    174174#endif
    175175    /** Source position where the lock was taken. */
    176     RTLOCKVALIDATORSRCPOS               SrcPos;
    177 } RTLOCKVALIDATORSHAREDONE;
    178 AssertCompileSize(RTLOCKVALIDATORSHAREDONE, HC_ARCH_BITS == 32 ? 24 + 16 : 32 + 32);
    179 /** Pointer to a RTLOCKVALIDATORSHAREDONE. */
    180 typedef RTLOCKVALIDATORSHAREDONE *PRTLOCKVALIDATORSHAREDONE;
     176    RTLOCKVALSRCPOS                     SrcPos;
     177} RTLOCKVALRECSHRDOWN;
     178AssertCompileSize(RTLOCKVALRECSHRDOWN, HC_ARCH_BITS == 32 ? 24 + 16 : 32 + 32);
     179/** Pointer to a RTLOCKVALRECSHRDOWN. */
     180typedef RTLOCKVALRECSHRDOWN *PRTLOCKVALRECSHRDOWN;
    181181
    182182/**
     
    186186 * the lock validator.
    187187 */
    188 typedef struct RTLOCKVALIDATORSHARED
     188typedef struct RTLOCKVALRECSHRD
    189189{
    190     /** Record core with RTLOCKVALIDATORSHARED_MAGIC as the magic value. */
    191     RTLOCKVALIDATORRECCORE              Core;
     190    /** Record core with RTLOCKVALRECSHRD_MAGIC as the magic value. */
     191    RTLOCKVALRECCORE                    Core;
    192192    /** The lock sub-class. */
    193193    uint32_t volatile                   uSubClass;
     
    200200    /** Pointer to the next sibling record.
    201201     * This is used to find the write side of a read-write lock.  */
    202     R3R0PTRTYPE(PRTLOCKVALIDATORRECUNION) pSibling;
     202    R3R0PTRTYPE(PRTLOCKVALRECUNION)    pSibling;
    203203
    204204    /** The number of entries in the table.
     
    219219    bool                                afPadding[2];
    220220    /** Pointer to a table containing pointers to records of all the owners. */
    221     R3R0PTRTYPE(PRTLOCKVALIDATORSHAREDONE volatile *) papOwners;
     221    R3R0PTRTYPE(PRTLOCKVALRECSHRDOWN volatile *) papOwners;
    222222#if HC_ARCH_BITS == 32
    223223    /** Alignment padding. */
    224224    uint32_t                            u32Alignment;
    225225#endif
    226 } RTLOCKVALIDATORSHARED;
    227 AssertCompileSize(RTLOCKVALIDATORSHARED, HC_ARCH_BITS == 32 ? 24 + 20 + 4 : 40 + 24);
     226} RTLOCKVALRECSHRD;
     227AssertCompileSize(RTLOCKVALRECSHRD, HC_ARCH_BITS == 32 ? 24 + 20 + 4 : 40 + 24);
    228228
    229229
     
    244244 * Initialize a lock validator record.
    245245 *
    246  * Use RTLockValidatorRecDelete to deinitialize it.
     246 * Use RTLockValidatorRecExclDelete to deinitialize it.
    247247 *
    248248 * @param   pRec                The record.
     
    255255 * @param   hLock               The lock handle.
    256256 */
    257 RTDECL(void) RTLockValidatorRecInit(PRTLOCKVALIDATORREC pRec, RTLOCKVALIDATORCLASS hClass,
    258                                     uint32_t uSubClass, const char *pszName, void *hLock);
     257RTDECL(void) RTLockValidatorRecExclInit(PRTLOCKVALRECEXCL pRec, RTLOCKVALIDATORCLASS hClass,
     258                                        uint32_t uSubClass, const char *pszName, void *hLock);
    259259/**
    260260 * Uninitialize a lock validator record previously initialized by
     
    263263 * @param   pRec                The record.  Must be valid.
    264264 */
    265 RTDECL(void) RTLockValidatorRecDelete(PRTLOCKVALIDATORREC pRec);
     265RTDECL(void) RTLockValidatorRecExclDelete(PRTLOCKVALRECEXCL pRec);
    266266
    267267/**
    268268 * Create and initialize a lock validator record.
    269269 *
    270  * Use RTLockValidatorRecDestroy to deinitialize and destroy the returned
     270 * Use RTLockValidatorRecExclDestroy to deinitialize and destroy the returned
    271271 * record.
    272272 *
     
    281281 * @param   hLock               The lock handle.
    282282 */
    283 RTDECL(int)  RTLockValidatorRecCreate(PRTLOCKVALIDATORREC *ppRec, RTLOCKVALIDATORCLASS hClass,
    284                                       uint32_t uSubClass, const char *pszName, void *hLock);
    285 
    286 /**
    287  * Deinitialize and destroy a record created by RTLockValidatorRecCreate.
     283RTDECL(int)  RTLockValidatorRecExclCreate(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALIDATORCLASS hClass,
     284                                          uint32_t uSubClass, const char *pszName, void *hLock);
     285
     286/**
     287 * Deinitialize and destroy a record created by RTLockValidatorRecExclCreate.
    288288 *
    289289 * @param   ppRec               Pointer to the record pointer.  Will be set to
    290290 *                              NULL.
    291291 */
    292 RTDECL(void) RTLockValidatorRecDestroy(PRTLOCKVALIDATORREC *ppRec);
     292RTDECL(void) RTLockValidatorRecExclDestroy(PRTLOCKVALRECEXCL *ppRec);
    293293
    294294/**
    295295 * Initialize a lock validator record for a shared lock.
    296296 *
    297  * Use RTLockValidatorSharedRecDelete to deinitialize it.
     297 * Use RTLockValidatorRecSharedDelete to deinitialize it.
    298298 *
    299299 * @param   pRec                The shared lock record.
     
    306306 * @param   hLock               The lock handle.
    307307 */
    308 RTDECL(void) RTLockValidatorSharedRecInit(PRTLOCKVALIDATORSHARED pRec, RTLOCKVALIDATORCLASS hClass,
     308RTDECL(void) RTLockValidatorRecSharedInit(PRTLOCKVALRECSHRD pRec, RTLOCKVALIDATORCLASS hClass,
    309309                                          uint32_t uSubClass, const char *pszName, void *hLock);
    310310/**
    311311 * Uninitialize a lock validator record previously initialized by
    312  * RTLockValidatorSharedRecInit.
     312 * RTLockValidatorRecSharedInit.
    313313 *
    314314 * @param   pRec                The shared lock record.  Must be valid.
    315315 */
    316 RTDECL(void) RTLockValidatorSharedRecDelete(PRTLOCKVALIDATORSHARED pRec);
     316RTDECL(void) RTLockValidatorRecSharedDelete(PRTLOCKVALRECSHRD pRec);
    317317
    318318/**
     
    324324 * @param   pRec2               Record 2.
    325325 */
    326 RTDECL(int) RTLockValidatorMakeSiblings(PRTLOCKVALIDATORRECCORE pRec1, PRTLOCKVALIDATORRECCORE pRec2);
     326RTDECL(int) RTLockValidatorRecMakeSiblings(PRTLOCKVALRECCORE pRec1, PRTLOCKVALRECCORE pRec2);
    327327
    328328/**
     
    342342 * @param   pSrcPos             The source position of the lock operation.
    343343 */
    344 RTDECL(int)  RTLockValidatorCheckOrder(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread, PCRTLOCKVALIDATORSRCPOS pSrcPos);
     344RTDECL(int)  RTLockValidatorCheckOrder(PRTLOCKVALRECEXCL pRec, RTTHREAD hThread, PCRTLOCKVALSRCPOS pSrcPos);
    345345
    346346/**
     
    361361 * @param   pSrcPos             The source position of the lock operation.
    362362 */
    363 RTDECL(int) RTLockValidatorCheckBlocking(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread,
     363RTDECL(int) RTLockValidatorCheckBlocking(PRTLOCKVALRECEXCL pRec, RTTHREAD hThread,
    364364                                         RTTHREADSTATE enmState, bool fRecursiveOk,
    365                                          PCRTLOCKVALIDATORSRCPOS pSrcPos);
     365                                         PCRTLOCKVALSRCPOS pSrcPos);
    366366
    367367/**
     
    384384 * @param   pSrcPos             The source position of the lock operation.
    385385 */
    386 RTDECL(int) RTLockValidatorCheckWriteOrderBlocking(PRTLOCKVALIDATORREC pWrite, PRTLOCKVALIDATORSHARED pRead,
     386RTDECL(int) RTLockValidatorCheckWriteOrderBlocking(PRTLOCKVALRECEXCL pWrite, PRTLOCKVALRECSHRD pRead,
    387387                                                   RTTHREAD hThread, RTTHREADSTATE enmState, bool fRecursiveOk,
    388                                                    PCRTLOCKVALIDATORSRCPOS pSrcPos);
     388                                                   PCRTLOCKVALSRCPOS pSrcPos);
    389389
    390390/**
     
    407407 * @param   pSrcPos             The source position of the lock operation.
    408408 */
    409 RTDECL(int) RTLockValidatorCheckReadOrderBlocking(PRTLOCKVALIDATORSHARED pRead, PRTLOCKVALIDATORREC pWrite,
     409RTDECL(int) RTLockValidatorCheckReadOrderBlocking(PRTLOCKVALRECSHRD pRead, PRTLOCKVALRECEXCL pWrite,
    410410                                                  RTTHREAD hThread, RTTHREADSTATE enmState, bool fRecursiveOk,
    411                                                   PCRTLOCKVALIDATORSRCPOS pSrcPos);
     411                                                  PCRTLOCKVALSRCPOS pSrcPos);
    412412
    413413/**
     
    423423 * @param   pRec                The validator record.
    424424 */
    425 RTDECL(int)  RTLockValidatorCheckAndRelease(PRTLOCKVALIDATORREC pRec);
     425RTDECL(int)  RTLockValidatorCheckAndRelease(PRTLOCKVALRECEXCL pRec);
    426426
    427427/**
     
    438438 * @param   hThread             The handle of the calling thread.
    439439 */
    440 RTDECL(int)  RTLockValidatorCheckAndReleaseReadOwner(PRTLOCKVALIDATORSHARED pRead, RTTHREAD hThread);
     440RTDECL(int)  RTLockValidatorCheckAndReleaseReadOwner(PRTLOCKVALRECSHRD pRead, RTTHREAD hThread);
    441441
    442442/**
     
    453453 * @param   pSrcPos             The source position of the lock operation.
    454454 */
    455 RTDECL(int) RTLockValidatorRecordRecursion(PRTLOCKVALIDATORREC pRec, PCRTLOCKVALIDATORSRCPOS pSrcPos);
     455RTDECL(int) RTLockValidatorRecordRecursion(PRTLOCKVALRECEXCL pRec, PCRTLOCKVALSRCPOS pSrcPos);
    456456
    457457/**
     
    467467 * @param   pRec                The validator record.
    468468 */
    469 RTDECL(int) RTLockValidatorUnwindRecursion(PRTLOCKVALIDATORREC pRec);
     469RTDECL(int) RTLockValidatorUnwindRecursion(PRTLOCKVALRECEXCL pRec);
    470470
    471471/**
     
    485485 * @param   pWrite              The validator record for the writer.
    486486 */
    487 RTDECL(int) RTLockValidatorRecordReadWriteRecursion(PRTLOCKVALIDATORREC pWrite, PRTLOCKVALIDATORSHARED pRead, PCRTLOCKVALIDATORSRCPOS pSrcPos);
     487RTDECL(int) RTLockValidatorRecordReadWriteRecursion(PRTLOCKVALRECEXCL pWrite, PRTLOCKVALRECSHRD pRead, PCRTLOCKVALSRCPOS pSrcPos);
    488488
    489489/**
     
    501501 * @param   pWrite              The validator record for the writer.
    502502 */
    503 RTDECL(int) RTLockValidatorUnwindReadWriteRecursion(PRTLOCKVALIDATORREC pWrite, PRTLOCKVALIDATORSHARED pRead);
     503RTDECL(int) RTLockValidatorUnwindReadWriteRecursion(PRTLOCKVALRECEXCL pWrite, PRTLOCKVALRECSHRD pRead);
    504504
    505505/**
     
    517517 * @param   pSrcPos             The source position of the lock operation.
    518518 */
    519 RTDECL(RTTHREAD) RTLockValidatorSetOwner(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread, PCRTLOCKVALIDATORSRCPOS pSrcPos);
     519RTDECL(RTTHREAD) RTLockValidatorSetOwner(PRTLOCKVALRECEXCL pRec, RTTHREAD hThread, PCRTLOCKVALSRCPOS pSrcPos);
    520520
    521521/**
     
    528528 * @param   pRec                The validator record.
    529529 */
    530 RTDECL(RTTHREAD) RTLockValidatorUnsetOwner(PRTLOCKVALIDATORREC pRec);
     530RTDECL(RTTHREAD) RTLockValidatorUnsetOwner(PRTLOCKVALRECEXCL pRec);
    531531
    532532/**
     
    540540 * @param   pSrcPos             The source position of the lock operation.
    541541 */
    542 RTDECL(void) RTLockValidatorAddReadOwner(PRTLOCKVALIDATORSHARED pRead, RTTHREAD hThread, PCRTLOCKVALIDATORSRCPOS pSrcPos);
     542RTDECL(void) RTLockValidatorAddReadOwner(PRTLOCKVALRECSHRD pRead, RTTHREAD hThread, PCRTLOCKVALSRCPOS pSrcPos);
    543543
    544544/**
     
    551551 * @param   hThread             The thread to to remove.
    552552 */
    553 RTDECL(void) RTLockValidatorRemoveReadOwner(PRTLOCKVALIDATORSHARED pRead, RTTHREAD hThread);
     553RTDECL(void) RTLockValidatorRemoveReadOwner(PRTLOCKVALRECSHRD pRead, RTTHREAD hThread);
    554554
    555555/**
  • trunk/include/iprt/types.h

    r25591 r25607  
    14791479/** Pointer to a lock validator record.
    14801480 * The structure definition is found in iprt/lockvalidator.h.  */
    1481 typedef struct RTLOCKVALIDATORREC          *PRTLOCKVALIDATORREC;
     1481typedef struct RTLOCKVALRECEXCL        *PRTLOCKVALRECEXCL;
    14821482/** Pointer to a lock validator source poisition.
    14831483 * The structure definition is found in iprt/lockvalidator.h.  */
    1484 typedef struct RTLOCKVALIDATORSRCPOS       *PRTLOCKVALIDATORSRCPOS;
     1484typedef struct RTLOCKVALSRCPOS         *PRTLOCKVALSRCPOS;
    14851485/** Pointer to a const lock validator source poisition.
    14861486 * The structure definition is found in iprt/lockvalidator.h.  */
    1487 typedef struct RTLOCKVALIDATORSRCPOS const *PCRTLOCKVALIDATORSRCPOS;
     1487typedef struct RTLOCKVALSRCPOS const   *PCRTLOCKVALSRCPOS;
    14881488
    14891489
  • trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp

    r25604 r25607  
    5858{
    5959    /** The current record. */
    60     PRTLOCKVALIDATORRECUNION    pRec;
     60    PRTLOCKVALRECUNION    pRec;
    6161    /** The current entry number if pRec is a shared one. */
    6262    uint32_t                    iEntry;
     
    7070     * siblings.  This is used for validating a deadlock stack as well as
    7171     * terminating the sibling walk. */
    72     PRTLOCKVALIDATORRECUNION    pFirstSibling;
     72    PRTLOCKVALRECUNION    pFirstSibling;
    7373} RTLOCKVALIDATORDDENTRY;
    7474
     
    9292*******************************************************************************/
    9393/** Serializing object destruction and deadlock detection.
    94  * NS: RTLOCKVALIDATORREC and RTTHREADINT destruction.
     94 * NS: RTLOCKVALIDATORREC* and RTTHREADINT destruction.
    9595 * EW: Deadlock detection.
    9696 */
     
    114114
    115115/** Wrapper around ASMAtomicReadPtr. */
    116 DECL_FORCE_INLINE(PRTLOCKVALIDATORRECUNION) rtLockValidatorReadRecUnionPtr(PRTLOCKVALIDATORRECUNION volatile *ppRec)
    117 {
    118     return (PRTLOCKVALIDATORRECUNION)ASMAtomicReadPtr((void * volatile *)ppRec);
     116DECL_FORCE_INLINE(PRTLOCKVALRECUNION) rtLockValidatorReadRecUnionPtr(PRTLOCKVALRECUNION volatile *ppRec)
     117{
     118    return (PRTLOCKVALRECUNION)ASMAtomicReadPtr((void * volatile *)ppRec);
    119119}
    120120
    121121
    122122/** Wrapper around ASMAtomicWritePtr. */
    123 DECL_FORCE_INLINE(void) rtLockValidatorWriteRecUnionPtr(PRTLOCKVALIDATORRECUNION volatile *ppRec, PRTLOCKVALIDATORRECUNION pRecNew)
     123DECL_FORCE_INLINE(void) rtLockValidatorWriteRecUnionPtr(PRTLOCKVALRECUNION volatile *ppRec, PRTLOCKVALRECUNION pRecNew)
    124124{
    125125    ASMAtomicWritePtr((void * volatile *)ppRec, pRecNew);
     
    135135
    136136/** Wrapper around ASMAtomicUoReadPtr. */
    137 DECL_FORCE_INLINE(PRTLOCKVALIDATORSHAREDONE) rtLockValidatorUoReadSharedOwner(PRTLOCKVALIDATORSHAREDONE volatile *ppOwner)
    138 {
    139     return (PRTLOCKVALIDATORSHAREDONE)ASMAtomicUoReadPtr((void * volatile *)ppOwner);
     137DECL_FORCE_INLINE(PRTLOCKVALRECSHRDOWN) rtLockValidatorUoReadSharedOwner(PRTLOCKVALRECSHRDOWN volatile *ppOwner)
     138{
     139    return (PRTLOCKVALRECSHRDOWN)ASMAtomicUoReadPtr((void * volatile *)ppOwner);
    140140}
    141141
     
    189189 * @param   pszPrefix           Message suffix.
    190190 */
    191 static void rtLockValidatorComplainAboutLock(const char *pszPrefix, PRTLOCKVALIDATORRECUNION pRec, const char *pszSuffix)
     191static void rtLockValidatorComplainAboutLock(const char *pszPrefix, PRTLOCKVALRECUNION pRec, const char *pszSuffix)
    192192{
    193193    if (    VALID_PTR(pRec)
     
    196196        switch (pRec->Core.u32Magic)
    197197        {
    198             case RTLOCKVALIDATORREC_MAGIC:
     198            case RTLOCKVALRECEXCL_MAGIC:
    199199                RTAssertMsg2AddWeak("%s%p %s xrec=%p own=%s nest=%u pos={%Rbn(%u) %Rfn %p}%s", pszPrefix,
    200200                                    pRec->Excl.hLock, pRec->Excl.pszName, pRec,
     
    204204                break;
    205205
    206             case RTLOCKVALIDATORSHARED_MAGIC:
     206            case RTLOCKVALRECSHRD_MAGIC:
    207207                RTAssertMsg2AddWeak("%s%p %s srec=%p%s", pszPrefix,
    208208                                    pRec->Shared.hLock, pRec->Shared.pszName, pRec,
     
    210210                break;
    211211
    212             case RTLOCKVALIDATORSHAREDONE_MAGIC:
     212            case RTLOCKVALRECSHRDOWN_MAGIC:
    213213            {
    214                 PRTLOCKVALIDATORSHARED pShared = pRec->SharedOne.pSharedRec;
     214                PRTLOCKVALRECSHRD pShared = pRec->SharedOwn.pSharedRec;
    215215                if (    VALID_PTR(pShared)
    216                     &&  pShared->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC)
     216                    &&  pShared->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)
    217217                    RTAssertMsg2AddWeak("%s%p %s srec=%p trec=%p thr=%s nest=%u pos={%Rbn(%u) %Rfn %p}%s", pszPrefix,
    218218                                        pShared->hLock, pShared->pszName, pShared,
    219                                         pRec, rtLockValidatorNameThreadHandle(&pRec->SharedOne.hThread), pRec->SharedOne.cRecursion,
    220                                         pRec->SharedOne.SrcPos.pszFile, pRec->SharedOne.SrcPos.uLine, pRec->SharedOne.SrcPos.pszFunction, pRec->SharedOne.SrcPos.uId,
     219                                        pRec, rtLockValidatorNameThreadHandle(&pRec->SharedOwn.hThread), pRec->SharedOwn.cRecursion,
     220                                        pRec->SharedOwn.SrcPos.pszFile, pRec->SharedOwn.SrcPos.uLine, pRec->SharedOwn.SrcPos.pszFunction, pRec->SharedOwn.SrcPos.uId,
    221221                                        pszSuffix);
    222222                else
    223223                    RTAssertMsg2AddWeak("%sbad srec=%p trec=%p thr=%s nest=%u pos={%Rbn(%u) %Rfn %p}%s", pszPrefix,
    224224                                        pShared,
    225                                         pRec, rtLockValidatorNameThreadHandle(&pRec->SharedOne.hThread), pRec->SharedOne.cRecursion,
    226                                         pRec->SharedOne.SrcPos.pszFile, pRec->SharedOne.SrcPos.uLine, pRec->SharedOne.SrcPos.pszFunction, pRec->SharedOne.SrcPos.uId,
     225                                        pRec, rtLockValidatorNameThreadHandle(&pRec->SharedOwn.hThread), pRec->SharedOwn.cRecursion,
     226                                        pRec->SharedOwn.SrcPos.pszFile, pRec->SharedOwn.SrcPos.uLine, pRec->SharedOwn.SrcPos.pszFunction, pRec->SharedOwn.SrcPos.uId,
    227227                                        pszSuffix);
    228228                break;
     
    245245 * @param   pRec                The main lock involved. Can be NULL.
    246246 */
    247 static void rtLockValidatorComplainFirst(const char *pszWhat, PCRTLOCKVALIDATORSRCPOS pSrcPos, PRTTHREADINT pThreadSelf, PRTLOCKVALIDATORRECUNION pRec)
     247static void rtLockValidatorComplainFirst(const char *pszWhat, PCRTLOCKVALSRCPOS pSrcPos, PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION pRec)
    248248{
    249249    if (!ASMAtomicUoReadBool(&g_fLockValidatorQuiet))
     
    293293 * @param   pSrc                The source.
    294294 */
    295 DECL_FORCE_INLINE(void) rtLockValidatorCopySrcPos(PRTLOCKVALIDATORSRCPOS pDst, PCRTLOCKVALIDATORSRCPOS pSrc)
     295DECL_FORCE_INLINE(void) rtLockValidatorCopySrcPos(PRTLOCKVALSRCPOS pDst, PCRTLOCKVALSRCPOS pSrc)
    296296{
    297297    ASMAtomicUoWriteU32(&pDst->uLine,                           pSrc->uLine);
     
    307307 * @param   pSrcPos             The source position record.
    308308 */
    309 DECL_FORCE_INLINE(void) rtLockValidatorInitSrcPos(PRTLOCKVALIDATORSRCPOS pSrcPos)
     309DECL_FORCE_INLINE(void) rtLockValidatorInitSrcPos(PRTLOCKVALSRCPOS pSrcPos)
    310310{
    311311    pSrcPos->pszFile        = NULL;
     
    320320
    321321/**
    322  * Serializes destruction of RTLOCKVALIDATORREC and RTTHREADINT structures.
     322 * Serializes destruction of RTLOCKVALIDATORREC* and RTTHREADINT structures.
    323323 */
    324324DECLHIDDEN(void) rtLockValidatorSerializeDestructEnter(void)
     
    364364
    365365
    366 RTDECL(void) RTLockValidatorRecInit(PRTLOCKVALIDATORREC pRec, RTLOCKVALIDATORCLASS hClass,
    367                                     uint32_t uSubClass, const char *pszName, void *hLock)
    368 {
    369     pRec->Core.u32Magic = RTLOCKVALIDATORREC_MAGIC;
     366/**
     367 * Unlinks all siblings.
     368 *
     369 * This is used during record deletion and assumes no races.
     370 *
     371 * @param   pCore               One of the siblings.
     372 */
     373static void rtLockValidatorUnlinkAllSiblings(PRTLOCKVALRECCORE pCore)
     374{
     375    /* ASSUMES sibling destruction doesn't involve any races and that all
     376       related records are to be disposed off now.  */
     377    PRTLOCKVALRECUNION pSibling = (PRTLOCKVALRECUNION)pCore;
     378    while (pSibling)
     379    {
     380        PRTLOCKVALRECUNION volatile *ppCoreNext;
     381        switch (pSibling->Core.u32Magic)
     382        {
     383            case RTLOCKVALRECEXCL_MAGIC:
     384            case RTLOCKVALRECEXCL_MAGIC_DEAD:
     385                ppCoreNext = &pSibling->Excl.pSibling;
     386                break;
     387
     388            case RTLOCKVALRECSHRD_MAGIC:
     389            case RTLOCKVALRECSHRD_MAGIC_DEAD:
     390                ppCoreNext = &pSibling->Shared.pSibling;
     391                break;
     392
     393            default:
     394                AssertFailed();
     395                ppCoreNext = NULL;
     396                break;
     397        }
     398        if (RT_UNLIKELY(ppCoreNext))
     399            break;
     400        pSibling = (PRTLOCKVALRECUNION)ASMAtomicXchgPtr((void * volatile *)ppCoreNext, NULL);
     401    }
     402}
     403
     404
     405RTDECL(void) RTLockValidatorRecExclInit(PRTLOCKVALRECEXCL pRec, RTLOCKVALIDATORCLASS hClass,
     406                                        uint32_t uSubClass, const char *pszName, void *hLock)
     407{
     408    pRec->Core.u32Magic = RTLOCKVALRECEXCL_MAGIC;
    370409    pRec->fEnabled      = RTLockValidatorIsEnabled();
    371410    pRec->afReserved[0] = 0;
     
    396435
    397436
    398 RTDECL(int)  RTLockValidatorRecCreate(PRTLOCKVALIDATORREC *ppRec, RTLOCKVALIDATORCLASS hClass,
    399                                       uint32_t uSubClass, const char *pszName, void *pvLock)
    400 {
    401     PRTLOCKVALIDATORREC pRec;
    402     *ppRec = pRec = (PRTLOCKVALIDATORREC)RTMemAlloc(sizeof(*pRec));
     437RTDECL(int)  RTLockValidatorRecExclCreate(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALIDATORCLASS hClass,
     438                                          uint32_t uSubClass, const char *pszName, void *pvLock)
     439{
     440    PRTLOCKVALRECEXCL pRec;
     441    *ppRec = pRec = (PRTLOCKVALRECEXCL)RTMemAlloc(sizeof(*pRec));
    403442    if (!pRec)
    404443        return VERR_NO_MEMORY;
    405444
    406     RTLockValidatorRecInit(pRec, hClass, uSubClass, pszName, pvLock);
     445    RTLockValidatorRecExclInit(pRec, hClass, uSubClass, pszName, pvLock);
    407446
    408447    return VINF_SUCCESS;
     
    410449
    411450
    412 /**
    413  * Unlinks all siblings.
    414  *
    415  * This is used during record deletion and assumes no races.
    416  *
    417  * @param   pCore               One of the siblings.
    418  */
    419 static void rtLockValidatorUnlinkAllSiblings(PRTLOCKVALIDATORRECCORE pCore)
    420 {
    421     /* ASSUMES sibling destruction doesn't involve any races and that all
    422        related records are to be disposed off now.  */
    423     PRTLOCKVALIDATORRECUNION pSibling = (PRTLOCKVALIDATORRECUNION)pCore;
    424     while (pSibling)
    425     {
    426         PRTLOCKVALIDATORRECUNION volatile *ppCoreNext;
    427         switch (pSibling->Core.u32Magic)
    428         {
    429             case RTLOCKVALIDATORREC_MAGIC:
    430             case RTLOCKVALIDATORREC_MAGIC_DEAD:
    431                 ppCoreNext = &pSibling->Excl.pSibling;
    432                 break;
    433 
    434             case RTLOCKVALIDATORSHARED_MAGIC:
    435             case RTLOCKVALIDATORSHARED_MAGIC_DEAD:
    436                 ppCoreNext = &pSibling->Shared.pSibling;
    437                 break;
    438 
    439             default:
    440                 AssertFailed();
    441                 ppCoreNext = NULL;
    442                 break;
    443         }
    444         if (RT_UNLIKELY(ppCoreNext))
    445             break;
    446         pSibling = (PRTLOCKVALIDATORRECUNION)ASMAtomicXchgPtr((void * volatile *)ppCoreNext, NULL);
    447     }
    448 }
    449 
    450 
    451 RTDECL(void) RTLockValidatorRecDelete(PRTLOCKVALIDATORREC pRec)
    452 {
    453     Assert(pRec->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC);
     451RTDECL(void) RTLockValidatorRecExclDelete(PRTLOCKVALRECEXCL pRec)
     452{
     453    Assert(pRec->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC);
    454454
    455455    rtLockValidatorSerializeDestructEnter();
    456456
    457     ASMAtomicWriteU32(&pRec->Core.u32Magic, RTLOCKVALIDATORREC_MAGIC_DEAD);
     457    ASMAtomicWriteU32(&pRec->Core.u32Magic, RTLOCKVALRECEXCL_MAGIC_DEAD);
    458458    ASMAtomicWriteHandle(&pRec->hThread, NIL_RTTHREAD);
    459459    ASMAtomicWriteHandle(&pRec->hClass, NIL_RTLOCKVALIDATORCLASS);
     
    464464
    465465
    466 RTDECL(void) RTLockValidatorRecDestroy(PRTLOCKVALIDATORREC *ppRec)
    467 {
    468     PRTLOCKVALIDATORREC pRec = *ppRec;
     466RTDECL(void) RTLockValidatorRecExclDestroy(PRTLOCKVALRECEXCL *ppRec)
     467{
     468    PRTLOCKVALRECEXCL pRec = *ppRec;
    469469    *ppRec = NULL;
    470470    if (pRec)
    471471    {
    472         RTLockValidatorRecDelete(pRec);
     472        RTLockValidatorRecExclDelete(pRec);
    473473        RTMemFree(pRec);
    474474    }
     
    476476
    477477
    478 RTDECL(void) RTLockValidatorSharedRecInit(PRTLOCKVALIDATORSHARED pRec, RTLOCKVALIDATORCLASS hClass,
     478RTDECL(void) RTLockValidatorRecSharedInit(PRTLOCKVALRECSHRD pRec, RTLOCKVALIDATORCLASS hClass,
    479479                                          uint32_t uSubClass, const char *pszName, void *hLock)
    480480{
    481     pRec->Core.u32Magic = RTLOCKVALIDATORSHARED_MAGIC;
     481    pRec->Core.u32Magic = RTLOCKVALRECSHRD_MAGIC;
    482482    pRec->uSubClass     = uSubClass;
    483483    pRec->hClass        = hClass;
     
    501501
    502502
    503 RTDECL(void) RTLockValidatorSharedRecDelete(PRTLOCKVALIDATORSHARED pRec)
    504 {
    505     Assert(pRec->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC);
     503RTDECL(void) RTLockValidatorRecSharedDelete(PRTLOCKVALRECSHRD pRec)
     504{
     505    Assert(pRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC);
    506506
    507507    /*
     
    519519    }
    520520
    521     ASMAtomicWriteU32(&pRec->Core.u32Magic, RTLOCKVALIDATORSHARED_MAGIC_DEAD);
     521    ASMAtomicWriteU32(&pRec->Core.u32Magic, RTLOCKVALRECSHRD_MAGIC_DEAD);
    522522    ASMAtomicUoWriteHandle(&pRec->hClass, NIL_RTLOCKVALIDATORCLASS);
    523523    if (pRec->papOwners)
    524524    {
    525         PRTLOCKVALIDATORSHAREDONE volatile *papOwners = pRec->papOwners;
     525        PRTLOCKVALRECSHRDOWN volatile *papOwners = pRec->papOwners;
    526526        ASMAtomicUoWritePtr((void * volatile *)&pRec->papOwners, NULL);
    527527        ASMAtomicUoWriteU32(&pRec->cAllocated, 0);
     
    545545 * @param   piEntry             Where to optionally return the table in index.
    546546 */
    547 DECLINLINE(PRTLOCKVALIDATORSHAREDONE)
    548 rtLockValidatorSharedRecFindThread(PRTLOCKVALIDATORSHARED pShared, RTTHREAD hThread, uint32_t *piEntry)
     547DECLINLINE(PRTLOCKVALRECSHRDOWN)
     548rtLockValidatorSharedRecFindThread(PRTLOCKVALRECSHRD pShared, RTTHREAD hThread, uint32_t *piEntry)
    549549{
    550550    rtLockValidatorSerializeDetectionEnter();
    551551    if (pShared->papOwners)
    552552    {
    553         PRTLOCKVALIDATORSHAREDONE volatile *papOwners = pShared->papOwners;
     553        PRTLOCKVALRECSHRDOWN volatile *papOwners = pShared->papOwners;
    554554        uint32_t const                      cMax      = pShared->cAllocated;
    555555        for (uint32_t iEntry = 0; iEntry < cMax; iEntry++)
    556556        {
    557             PRTLOCKVALIDATORSHAREDONE pEntry = rtLockValidatorUoReadSharedOwner(&papOwners[iEntry]);
     557            PRTLOCKVALRECSHRDOWN pEntry = rtLockValidatorUoReadSharedOwner(&papOwners[iEntry]);
    558558            if (pEntry && pEntry->hThread == hThread)
    559559            {
     
    578578 * @param   pSrcPos             The source position.
    579579 */
    580 DECLINLINE(PRTLOCKVALIDATORSHAREDONE)
    581 rtLockValidatorSharedRecAllocThread(PRTLOCKVALIDATORSHARED pRead, RTTHREAD hThread, PCRTLOCKVALIDATORSRCPOS pSrcPos)
    582 {
    583     PRTLOCKVALIDATORSHAREDONE pEntry;
    584 
    585     pEntry = (PRTLOCKVALIDATORSHAREDONE)RTMemAlloc(sizeof(RTLOCKVALIDATORSHAREDONE));
     580DECLINLINE(PRTLOCKVALRECSHRDOWN)
     581rtLockValidatorSharedRecAllocThread(PRTLOCKVALRECSHRD pRead, RTTHREAD hThread, PCRTLOCKVALSRCPOS pSrcPos)
     582{
     583    PRTLOCKVALRECSHRDOWN pEntry;
     584
     585    pEntry = (PRTLOCKVALRECSHRDOWN)RTMemAlloc(sizeof(RTLOCKVALRECSHRDOWN));
    586586    if (pEntry)
    587587    {
    588         pEntry->Core.u32Magic   = RTLOCKVALIDATORSHAREDONE_MAGIC;
     588        pEntry->Core.u32Magic   = RTLOCKVALRECSHRDOWN_MAGIC;
    589589        pEntry->cRecursion      = 1;
    590590        pEntry->hThread         = hThread;
     
    608608 * @param   pEntry              The thread entry.
    609609 */
    610 DECLINLINE(void) rtLockValidatorSharedRecFreeThread(PRTLOCKVALIDATORSHAREDONE pEntry)
     610DECLINLINE(void) rtLockValidatorSharedRecFreeThread(PRTLOCKVALRECSHRDOWN pEntry)
    611611{
    612612    if (pEntry)
    613613    {
    614614        rtLockValidatorSerializeDestructEnter();
    615         ASMAtomicWriteU32(&pEntry->Core.u32Magic, RTLOCKVALIDATORSHAREDONE_MAGIC_DEAD);
     615        ASMAtomicWriteU32(&pEntry->Core.u32Magic, RTLOCKVALRECSHRDOWN_MAGIC_DEAD);
    616616        ASMAtomicWriteHandle(&pEntry->hThread, NIL_RTTHREAD);
    617617        rtLockValidatorSerializeDestructLeave();
     
    631631 * @param   pShared             The shared lock record.
    632632 */
    633 static bool rtLockValidatorSharedRecMakeRoom(PRTLOCKVALIDATORSHARED pShared)
     633static bool rtLockValidatorSharedRecMakeRoom(PRTLOCKVALRECSHRD pShared)
    634634{
    635635    for (unsigned i = 0; i < 1000; i++)
     
    649649         * Try grab the privilege to reallocating the table.
    650650         */
    651         if (    pShared->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC
     651        if (    pShared->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC
    652652            &&  ASMAtomicCmpXchgBool(&pShared->fReallocating, true, false))
    653653        {
     
    663663                uint32_t                    cInc = RT_ALIGN_32(pShared->cEntries - cAllocated, 1);
    664664#endif
    665                 PRTLOCKVALIDATORSHAREDONE  *papOwners;
    666                 papOwners = (PRTLOCKVALIDATORSHAREDONE *)RTMemRealloc((void *)pShared->papOwners,
     665                PRTLOCKVALRECSHRDOWN  *papOwners;
     666                papOwners = (PRTLOCKVALRECSHRDOWN *)RTMemRealloc((void *)pShared->papOwners,
    667667                                                                      (cAllocated + cInc) * sizeof(void *));
    668668                if (!papOwners)
     
    688688
    689689        rtLockValidatorSerializeDetectionEnter();
    690         if (RT_UNLIKELY(pShared->Core.u32Magic != RTLOCKVALIDATORSHARED_MAGIC))
     690        if (RT_UNLIKELY(pShared->Core.u32Magic != RTLOCKVALRECSHRD_MAGIC))
    691691            break;
    692692
     
    708708 * @param   pEntry              The thread entry.
    709709 */
    710 DECLINLINE(bool) rtLockValidatorSharedRecAddThread(PRTLOCKVALIDATORSHARED pShared, PRTLOCKVALIDATORSHAREDONE pEntry)
     710DECLINLINE(bool) rtLockValidatorSharedRecAddThread(PRTLOCKVALRECSHRD pShared, PRTLOCKVALRECSHRDOWN pEntry)
    711711{
    712712    rtLockValidatorSerializeDetectionEnter();
    713     if (RT_LIKELY(pShared->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC)) /* paranoia */
     713    if (RT_LIKELY(pShared->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)) /* paranoia */
    714714    {
    715715        if (   ASMAtomicIncU32(&pShared->cEntries) > pShared->cAllocated /** @todo add fudge */
     
    717717            return false; /* the worker leave the lock */
    718718
    719         PRTLOCKVALIDATORSHAREDONE volatile *papOwners = pShared->papOwners;
     719        PRTLOCKVALRECSHRDOWN volatile *papOwners = pShared->papOwners;
    720720        uint32_t const                      cMax      = pShared->cAllocated;
    721721        for (unsigned i = 0; i < 100; i++)
     
    745745 * @param   iEntry              The last known index.
    746746 */
    747 DECLINLINE(void) rtLockValidatorSharedRecRemoveAndFree(PRTLOCKVALIDATORSHARED pShared, PRTLOCKVALIDATORSHAREDONE pEntry,
     747DECLINLINE(void) rtLockValidatorSharedRecRemoveAndFree(PRTLOCKVALRECSHRD pShared, PRTLOCKVALRECSHRDOWN pEntry,
    748748                                                       uint32_t iEntry)
    749749{
     
    752752     */
    753753    rtLockValidatorSerializeDetectionEnter();
    754     AssertReturnVoidStmt(pShared->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC, rtLockValidatorSerializeDetectionLeave());
     754    AssertReturnVoidStmt(pShared->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, rtLockValidatorSerializeDetectionLeave());
    755755    if (RT_UNLIKELY(   iEntry >= pShared->cAllocated
    756756                    || !ASMAtomicCmpXchgPtr((void * volatile *)&pShared->papOwners[iEntry], NULL, pEntry)))
     
    758758        /* this shouldn't happen yet... */
    759759        AssertFailed();
    760         PRTLOCKVALIDATORSHAREDONE volatile *papOwners = pShared->papOwners;
     760        PRTLOCKVALRECSHRDOWN volatile *papOwners = pShared->papOwners;
    761761        uint32_t const                      cMax      = pShared->cAllocated;
    762762        for (iEntry = 0; iEntry < cMax; iEntry++)
     
    776776
    777777
    778 RTDECL(int) RTLockValidatorMakeSiblings(PRTLOCKVALIDATORRECCORE pRec1, PRTLOCKVALIDATORRECCORE pRec2)
     778RTDECL(int) RTLockValidatorRecMakeSiblings(PRTLOCKVALRECCORE pRec1, PRTLOCKVALRECCORE pRec2)
    779779{
    780780    /*
    781781     * Validate input.
    782782     */
    783     PRTLOCKVALIDATORRECUNION p1 = (PRTLOCKVALIDATORRECUNION)pRec1;
    784     PRTLOCKVALIDATORRECUNION p2 = (PRTLOCKVALIDATORRECUNION)pRec2;
     783    PRTLOCKVALRECUNION p1 = (PRTLOCKVALRECUNION)pRec1;
     784    PRTLOCKVALRECUNION p2 = (PRTLOCKVALRECUNION)pRec2;
    785785
    786786    AssertPtrReturn(p1, VERR_SEM_LV_INVALID_PARAMETER);
    787     AssertReturn(   p1->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC
    788                  || p1->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC
     787    AssertReturn(   p1->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC
     788                 || p1->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC
    789789                 , VERR_SEM_LV_INVALID_PARAMETER);
    790790
    791791    AssertPtrReturn(p2, VERR_SEM_LV_INVALID_PARAMETER);
    792     AssertReturn(   p2->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC
    793                  || p2->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC
     792    AssertReturn(   p2->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC
     793                 || p2->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC
    794794                 , VERR_SEM_LV_INVALID_PARAMETER);
    795795
    796796    /*
    797      * Link them.
    798      */
    799     if (    p1->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC
    800         &&  p2->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC)
     797     * Link them (circular list).
     798     */
     799    if (    p1->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC
     800        &&  p2->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)
    801801    {
    802802        p1->Excl.pSibling   = p2;
    803803        p2->Shared.pSibling = p1;
    804804    }
    805     else if (   p1->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC
    806              && p2->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC)
     805    else if (   p1->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC
     806             && p2->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC)
    807807    {
    808808        p1->Shared.pSibling = p2;
     
    816816
    817817
    818 RTDECL(int) RTLockValidatorCheckOrder(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread, PCRTLOCKVALIDATORSRCPOS pSrcPos)
    819 {
    820     AssertReturn(pRec->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     818RTDECL(int) RTLockValidatorCheckOrder(PRTLOCKVALRECEXCL pRec, RTTHREAD hThread, PCRTLOCKVALSRCPOS pSrcPos)
     819{
     820    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    821821    if (!pRec->fEnabled)
    822822        return VINF_SUCCESS;
     
    835835
    836836
    837 RTDECL(int)  RTLockValidatorCheckAndRelease(PRTLOCKVALIDATORREC pRec)
    838 {
    839     AssertReturn(pRec->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     837RTDECL(int)  RTLockValidatorCheckAndRelease(PRTLOCKVALRECEXCL pRec)
     838{
     839    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    840840    if (!pRec->fEnabled)
    841841        return VINF_SUCCESS;
     
    847847
    848848
    849 RTDECL(int)  RTLockValidatorCheckAndReleaseReadOwner(PRTLOCKVALIDATORSHARED pRead, RTTHREAD hThread)
    850 {
    851     AssertReturn(pRead->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     849RTDECL(int)  RTLockValidatorCheckAndReleaseReadOwner(PRTLOCKVALRECSHRD pRead, RTTHREAD hThread)
     850{
     851    AssertReturn(pRead->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    852852    if (!pRead->fEnabled)
    853853        return VINF_SUCCESS;
     
    858858     */
    859859    uint32_t                    iEntry = 0;
    860     PRTLOCKVALIDATORSHAREDONE   pEntry = rtLockValidatorSharedRecFindThread(pRead, hThread, &iEntry);
     860    PRTLOCKVALRECSHRDOWN   pEntry = rtLockValidatorSharedRecFindThread(pRead, hThread, &iEntry);
    861861    AssertReturn(pEntry, VERR_SEM_LV_NOT_OWNER);
    862862
     
    882882
    883883
    884 RTDECL(int) RTLockValidatorRecordRecursion(PRTLOCKVALIDATORREC pRec, PCRTLOCKVALIDATORSRCPOS pSrcPos)
    885 {
    886     AssertReturn(pRec->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     884RTDECL(int) RTLockValidatorRecordRecursion(PRTLOCKVALRECEXCL pRec, PCRTLOCKVALSRCPOS pSrcPos)
     885{
     886    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    887887    if (!pRec->fEnabled)
    888888        return VINF_SUCCESS;
     
    896896
    897897
    898 RTDECL(int) RTLockValidatorUnwindRecursion(PRTLOCKVALIDATORREC pRec)
    899 {
    900     AssertReturn(pRec->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     898RTDECL(int) RTLockValidatorUnwindRecursion(PRTLOCKVALRECEXCL pRec)
     899{
     900    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    901901    if (!pRec->fEnabled)
    902902        return VINF_SUCCESS;
     
    910910
    911911
    912 RTDECL(int) RTLockValidatorRecordReadWriteRecursion(PRTLOCKVALIDATORREC pWrite, PRTLOCKVALIDATORSHARED pRead, PCRTLOCKVALIDATORSRCPOS pSrcPos)
    913 {
    914     AssertReturn(pWrite->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    915     AssertReturn(pRead->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     912RTDECL(int) RTLockValidatorRecordReadWriteRecursion(PRTLOCKVALRECEXCL pWrite, PRTLOCKVALRECSHRD pRead, PCRTLOCKVALSRCPOS pSrcPos)
     913{
     914    AssertReturn(pWrite->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     915    AssertReturn(pRead->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    916916    AssertReturn(pRead->fEnabled == pWrite->fEnabled, VERR_SEM_LV_INVALID_PARAMETER);
    917917    if (!pWrite->fEnabled)
     
    927927
    928928
    929 RTDECL(int) RTLockValidatorUnwindReadWriteRecursion(PRTLOCKVALIDATORREC pWrite, PRTLOCKVALIDATORSHARED pRead)
    930 {
    931     AssertReturn(pWrite->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    932     AssertReturn(pRead->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     929RTDECL(int) RTLockValidatorUnwindReadWriteRecursion(PRTLOCKVALRECEXCL pWrite, PRTLOCKVALRECSHRD pRead)
     930{
     931    AssertReturn(pWrite->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     932    AssertReturn(pRead->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    933933    AssertReturn(pRead->fEnabled == pWrite->fEnabled, VERR_SEM_LV_INVALID_PARAMETER);
    934934    if (!pWrite->fEnabled)
     
    943943
    944944
    945 RTDECL(RTTHREAD) RTLockValidatorSetOwner(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread, PCRTLOCKVALIDATORSRCPOS pSrcPos)
    946 {
    947     AssertReturn(pRec->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, NIL_RTTHREAD);
     945RTDECL(RTTHREAD) RTLockValidatorSetOwner(PRTLOCKVALRECEXCL pRec, RTTHREAD hThread, PCRTLOCKVALSRCPOS pSrcPos)
     946{
     947    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, NIL_RTTHREAD);
    948948    if (!pRec->fEnabled)
    949949        return VINF_SUCCESS;
     
    979979
    980980
    981 RTDECL(RTTHREAD) RTLockValidatorUnsetOwner(PRTLOCKVALIDATORREC pRec)
    982 {
    983     AssertReturn(pRec->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, NIL_RTTHREAD);
     981RTDECL(RTTHREAD) RTLockValidatorUnsetOwner(PRTLOCKVALRECEXCL pRec)
     982{
     983    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, NIL_RTTHREAD);
    984984    if (!pRec->fEnabled)
    985985        return VINF_SUCCESS;
     
    10061006
    10071007
    1008 RTDECL(void) RTLockValidatorAddReadOwner(PRTLOCKVALIDATORSHARED pRead, RTTHREAD hThread, PCRTLOCKVALIDATORSRCPOS pSrcPos)
    1009 {
    1010     AssertReturnVoid(pRead->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC);
     1008RTDECL(void) RTLockValidatorAddReadOwner(PRTLOCKVALRECSHRD pRead, RTTHREAD hThread, PCRTLOCKVALSRCPOS pSrcPos)
     1009{
     1010    AssertReturnVoid(pRead->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC);
    10111011    if (!pRead->fEnabled)
    10121012        return;
     
    10201020     *       so it can wait til later sometime.
    10211021     */
    1022     PRTLOCKVALIDATORSHAREDONE pEntry = rtLockValidatorSharedRecFindThread(pRead, hThread, NULL);
     1022    PRTLOCKVALRECSHRDOWN pEntry = rtLockValidatorSharedRecFindThread(pRead, hThread, NULL);
    10231023    if (pEntry)
    10241024    {
     
    10371037
    10381038
    1039 RTDECL(void) RTLockValidatorRemoveReadOwner(PRTLOCKVALIDATORSHARED pRead, RTTHREAD hThread)
    1040 {
    1041     AssertReturnVoid(pRead->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC);
     1039RTDECL(void) RTLockValidatorRemoveReadOwner(PRTLOCKVALRECSHRD pRead, RTTHREAD hThread)
     1040{
     1041    AssertReturnVoid(pRead->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC);
    10421042    if (!pRead->fEnabled)
    10431043        return;
     
    10481048     */
    10491049    uint32_t iEntry;
    1050     PRTLOCKVALIDATORSHAREDONE pEntry = rtLockValidatorSharedRecFindThread(pRead, hThread, &iEntry);
     1050    PRTLOCKVALRECSHRDOWN pEntry = rtLockValidatorSharedRecFindThread(pRead, hThread, &iEntry);
    10511051    AssertReturnVoid(pEntry);
    10521052    if (pEntry->cRecursion > 1)
     
    11931193 * @param   pFirstSibling   The first record we examined.
    11941194 */
    1195 DECL_FORCE_INLINE(bool) rtLockValidatorDdMoreWorkLeft(PRTLOCKVALIDATORRECUNION pRec, uint32_t iEntry, PRTLOCKVALIDATORRECUNION pFirstSibling)
    1196 {
    1197     PRTLOCKVALIDATORRECUNION pSibling;
     1195DECL_FORCE_INLINE(bool) rtLockValidatorDdMoreWorkLeft(PRTLOCKVALRECUNION pRec, uint32_t iEntry, PRTLOCKVALRECUNION pFirstSibling)
     1196{
     1197    PRTLOCKVALRECUNION pSibling;
    11981198
    11991199    switch (pRec->Core.u32Magic)
    12001200    {
    1201         case RTLOCKVALIDATORREC_MAGIC:
     1201        case RTLOCKVALRECEXCL_MAGIC:
    12021202            pSibling = pRec->Excl.pSibling;
    12031203            break;
    12041204
    1205         case RTLOCKVALIDATORSHARED_MAGIC:
     1205        case RTLOCKVALRECSHRD_MAGIC:
    12061206            if (iEntry + 1 < pRec->Shared.cAllocated)
    12071207                return true;
     
    12301230 * @param   pThreadSelf     The calling thread.
    12311231 */
    1232 static int rtLockValidatorDdDoDetection(PRTLOCKVALIDATORDDSTACK pStack, PRTLOCKVALIDATORRECUNION const pOriginalRec,
     1232static int rtLockValidatorDdDoDetection(PRTLOCKVALIDATORDDSTACK pStack, PRTLOCKVALRECUNION const pOriginalRec,
    12331233                                        PRTTHREADINT const pThreadSelf)
    12341234{
     
    12371237    /* We could use a single RTLOCKVALIDATORDDENTRY variable here, but the
    12381238       compiler may make a better job of it when using individual variables. */
    1239     PRTLOCKVALIDATORRECUNION    pRec            = pOriginalRec;
    1240     PRTLOCKVALIDATORRECUNION    pFirstSibling   = pOriginalRec;
     1239    PRTLOCKVALRECUNION    pRec            = pOriginalRec;
     1240    PRTLOCKVALRECUNION    pFirstSibling   = pOriginalRec;
    12411241    uint32_t                    iEntry          = UINT32_MAX;
    12421242    PRTTHREADINT                pThread         = NIL_RTTHREAD;
     
    12511251        switch (pRec->Core.u32Magic)
    12521252        {
    1253             case RTLOCKVALIDATORREC_MAGIC:
     1253            case RTLOCKVALRECEXCL_MAGIC:
    12541254                Assert(iEntry == UINT32_MAX);
    12551255                pNextThread = rtLockValidatorReadThreadHandle(&pRec->Excl.hThread);
     
    12681268                break;
    12691269
    1270             case RTLOCKVALIDATORSHARED_MAGIC:
     1270            case RTLOCKVALRECSHRD_MAGIC:
    12711271                /* Skip to the next sibling if same side.  ASSUMES reader priority. */
    12721272                /** @todo The read side of a read-write lock is problematic if
     
    12951295                {
    12961296                    uint32_t                            cAllocated = ASMAtomicUoReadU32(&pRec->Shared.cAllocated);
    1297                     PRTLOCKVALIDATORSHAREDONE volatile *papOwners  = pRec->Shared.papOwners;
     1297                    PRTLOCKVALRECSHRDOWN volatile *papOwners  = pRec->Shared.papOwners;
    12981298                    while (++iEntry < cAllocated)
    12991299                    {
    1300                         PRTLOCKVALIDATORSHAREDONE pEntry = rtLockValidatorUoReadSharedOwner(&papOwners[iEntry]);
     1300                        PRTLOCKVALRECSHRDOWN pEntry = rtLockValidatorUoReadSharedOwner(&papOwners[iEntry]);
    13011301                        if (   pEntry
    1302                             && pEntry->Core.u32Magic == RTLOCKVALIDATORSHAREDONE_MAGIC)
     1302                            && pEntry->Core.u32Magic == RTLOCKVALRECSHRDOWN_MAGIC)
    13031303                        {
    13041304                            pNextThread = rtLockValidatorReadThreadHandle(&pEntry->hThread);
     
    13121312                        }
    13131313                        else
    1314                             Assert(!pEntry || pEntry->Core.u32Magic == RTLOCKVALIDATORSHAREDONE_MAGIC_DEAD);
     1314                            Assert(!pEntry || pEntry->Core.u32Magic == RTLOCKVALRECSHRDOWN_MAGIC_DEAD);
    13151315                    }
    13161316                    if (pNextThread == NIL_RTTHREAD)
     
    13281328                break;
    13291329
    1330             case RTLOCKVALIDATORREC_MAGIC_DEAD:
    1331             case RTLOCKVALIDATORSHARED_MAGIC_DEAD:
     1330            case RTLOCKVALRECEXCL_MAGIC_DEAD:
     1331            case RTLOCKVALRECSHRD_MAGIC_DEAD:
    13321332                pNextThread = NIL_RTTHREAD;
    13331333                break;
    13341334
    1335             case RTLOCKVALIDATORSHAREDONE_MAGIC:
    1336             case RTLOCKVALIDATORSHAREDONE_MAGIC_DEAD:
     1335            case RTLOCKVALRECSHRDOWN_MAGIC:
     1336            case RTLOCKVALRECSHRDOWN_MAGIC_DEAD:
    13371337            default:
    13381338                AssertMsgFailed(("%p: %#x\n", pRec, pRec->Core));
     
    13431343        /* If we found a thread, check if it is still waiting for something. */
    13441344        RTTHREADSTATE               enmNextState = RTTHREADSTATE_RUNNING;
    1345         PRTLOCKVALIDATORRECUNION    pNextRec     = NULL;
     1345        PRTLOCKVALRECUNION    pNextRec     = NULL;
    13461346        if (   pNextThread != NIL_RTTHREAD
    13471347            && RT_LIKELY(pNextThread->u32Magic == RTTHREADINT_MAGIC))
     
    14231423 * @param   pOriginalRec    The original record.
    14241424 */
    1425 DECLINLINE(int) rtLockValidatorIsSimpleNoDeadlockCase(PRTLOCKVALIDATORRECUNION pOriginalRec)
    1426 {
    1427     if (    pOriginalRec->Excl.Core.u32Magic == RTLOCKVALIDATORREC_MAGIC
     1425DECLINLINE(int) rtLockValidatorIsSimpleNoDeadlockCase(PRTLOCKVALRECUNION pOriginalRec)
     1426{
     1427    if (    pOriginalRec->Excl.Core.u32Magic == RTLOCKVALRECEXCL_MAGIC
    14281428        &&  !pOriginalRec->Excl.pSibling)
    14291429    {
     
    14501450 * @param   rc              The return code.
    14511451 */
    1452 static void rcLockValidatorDoDeadlockComplaining(PRTLOCKVALIDATORDDSTACK pStack, PRTLOCKVALIDATORRECUNION pRec,
    1453                                                  PRTTHREADINT pThreadSelf, PCRTLOCKVALIDATORSRCPOS pSrcPos, int rc)
     1452static void rcLockValidatorDoDeadlockComplaining(PRTLOCKVALIDATORDDSTACK pStack, PRTLOCKVALRECUNION pRec,
     1453                                                 PRTTHREADINT pThreadSelf, PCRTLOCKVALSRCPOS pSrcPos, int rc)
    14541454{
    14551455    if (!ASMAtomicUoReadBool(&g_fLockValidatorQuiet))
     
    14681468            char szPrefix[24];
    14691469            RTStrPrintf(szPrefix, sizeof(szPrefix), "#%02u: ", i);
    1470             PRTLOCKVALIDATORSHAREDONE pSharedOne = NULL;
    1471             if (pStack->a[i].pRec->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC)
    1472                 pSharedOne = pStack->a[i].pRec->Shared.papOwners[pStack->a[i].iEntry];
    1473             if (VALID_PTR(pSharedOne) && pSharedOne->Core.u32Magic == RTLOCKVALIDATORSHAREDONE_MAGIC)
    1474                 rtLockValidatorComplainAboutLock(szPrefix, (PRTLOCKVALIDATORRECUNION)pSharedOne, "\n");
     1470            PRTLOCKVALRECSHRDOWN pSharedOwn = NULL;
     1471            if (pStack->a[i].pRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC)
     1472                pSharedOwn = pStack->a[i].pRec->Shared.papOwners[pStack->a[i].iEntry];
     1473            if (VALID_PTR(pSharedOwn) && pSharedOwn->Core.u32Magic == RTLOCKVALRECSHRDOWN_MAGIC)
     1474                rtLockValidatorComplainAboutLock(szPrefix, (PRTLOCKVALRECUNION)pSharedOwn, "\n");
    14751475            else
    14761476                rtLockValidatorComplainAboutLock(szPrefix, pStack->a[i].pRec, "\n");
     
    14951495 * @param   pSrcPos         The position of the current lock operation.
    14961496 */
    1497 static int rtLockValidatorDeadlockDetection(PRTLOCKVALIDATORRECUNION pRec, PRTTHREADINT pThreadSelf, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     1497static int rtLockValidatorDeadlockDetection(PRTLOCKVALRECUNION pRec, PRTTHREADINT pThreadSelf, PCRTLOCKVALSRCPOS pSrcPos)
    14981498{
    14991499#ifdef DEBUG_bird
     
    15271527
    15281528
    1529 RTDECL(int) RTLockValidatorCheckWriteOrderBlocking(PRTLOCKVALIDATORREC pWrite, PRTLOCKVALIDATORSHARED pRead,
     1529RTDECL(int) RTLockValidatorCheckWriteOrderBlocking(PRTLOCKVALRECEXCL pWrite, PRTLOCKVALRECSHRD pRead,
    15301530                                                   RTTHREAD hThread, RTTHREADSTATE enmState, bool fRecursiveOk,
    1531                                                    PCRTLOCKVALIDATORSRCPOS pSrcPos)
     1531                                                   PCRTLOCKVALSRCPOS pSrcPos)
    15321532{
    15331533    /*
    15341534     * Fend off wild life.
    15351535     */
    1536     PRTLOCKVALIDATORRECUNION pWriteU = (PRTLOCKVALIDATORRECUNION)pWrite; /* (avoid break aliasing rules) */
     1536    PRTLOCKVALRECUNION pWriteU = (PRTLOCKVALRECUNION)pWrite; /* (avoid break aliasing rules) */
    15371537    AssertPtrReturn(pWriteU, VERR_SEM_LV_INVALID_PARAMETER);
    1538     AssertReturn(pWriteU->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    1539     PRTLOCKVALIDATORRECUNION pReadU = (PRTLOCKVALIDATORRECUNION)pRead;
     1538    AssertReturn(pWriteU->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     1539    PRTLOCKVALRECUNION pReadU = (PRTLOCKVALRECUNION)pRead;
    15401540    AssertPtrReturn(pRead, VERR_SEM_LV_INVALID_PARAMETER);
    1541     AssertReturn(pReadU->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     1541    AssertReturn(pReadU->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    15421542    AssertReturn(pReadU->Shared.fEnabled == pWriteU->Excl.fEnabled, VERR_SEM_LV_INVALID_PARAMETER);
    15431543    if (!pWriteU->Excl.fEnabled)
     
    15561556     * Check for attempts at doing a read upgrade.
    15571557     */
    1558     PRTLOCKVALIDATORSHAREDONE pEntry = rtLockValidatorSharedRecFindThread(&pReadU->Shared, hThread, NULL);
     1558    PRTLOCKVALRECSHRDOWN pEntry = rtLockValidatorSharedRecFindThread(&pReadU->Shared, hThread, NULL);
    15591559    if (pEntry)
    15601560    {
    1561         rtLockValidatorComplainFirst("Read lock upgrade", pSrcPos, pThread, (PRTLOCKVALIDATORRECUNION)pEntry);
     1561        rtLockValidatorComplainFirst("Read lock upgrade", pSrcPos, pThread, (PRTLOCKVALRECUNION)pEntry);
    15621562        rtLockValidatorComplainPanic();
    15631563        return VERR_SEM_LV_UPGRADE;
     
    15701570
    15711571
    1572 RTDECL(int) RTLockValidatorCheckReadOrderBlocking(PRTLOCKVALIDATORSHARED pRead, PRTLOCKVALIDATORREC pWrite,
     1572RTDECL(int) RTLockValidatorCheckReadOrderBlocking(PRTLOCKVALRECSHRD pRead, PRTLOCKVALRECEXCL pWrite,
    15731573                                                  RTTHREAD hThread, RTTHREADSTATE enmState, bool fRecursiveOk,
    1574                                                   PCRTLOCKVALIDATORSRCPOS pSrcPos)
     1574                                                  PCRTLOCKVALSRCPOS pSrcPos)
    15751575{
    15761576    /*
     
    15781578     */
    15791579    AssertPtrReturn(pRead, VERR_SEM_LV_INVALID_PARAMETER);
    1580     AssertReturn(pRead->Core.u32Magic == RTLOCKVALIDATORSHARED_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     1580    AssertReturn(pRead->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    15811581    AssertPtrReturn(pWrite, VERR_SEM_LV_INVALID_PARAMETER);
    1582     AssertReturn(pWrite->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     1582    AssertReturn(pWrite->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    15831583    AssertReturn(pRead->fEnabled == pWrite->fEnabled, VERR_SEM_LV_INVALID_PARAMETER);
    15841584    if (!pRead->fEnabled)
     
    16001600
    16011601
    1602 RTDECL(int) RTLockValidatorCheckBlocking(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread,
     1602RTDECL(int) RTLockValidatorCheckBlocking(PRTLOCKVALRECEXCL pRec, RTTHREAD hThread,
    16031603                                         RTTHREADSTATE enmState, bool fRecursiveOk,
    1604                                          PCRTLOCKVALIDATORSRCPOS pSrcPos)
     1604                                         PCRTLOCKVALSRCPOS pSrcPos)
    16051605{
    16061606    /*
    16071607     * Fend off wild life.
    16081608     */
    1609     PRTLOCKVALIDATORRECUNION pRecU = (PRTLOCKVALIDATORRECUNION)pRec;
     1609    PRTLOCKVALRECUNION pRecU = (PRTLOCKVALRECUNION)pRec;
    16101610    AssertPtrReturn(pRecU, VERR_SEM_LV_INVALID_PARAMETER);
    1611     AssertReturn(pRecU->Core.u32Magic == RTLOCKVALIDATORREC_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
     1611    AssertReturn(pRecU->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
    16121612    if (!pRecU->Excl.fEnabled)
    16131613        return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/generic/critsect-generic.cpp

    r25604 r25607  
    6969    pCritSect->cLockers             = -1;
    7070    pCritSect->NativeThreadOwner    = NIL_RTNATIVETHREAD;
    71     int rc = RTLockValidatorRecCreate(&pCritSect->pValidatorRec, NIL_RTLOCKVALIDATORCLASS, 0, "RTCritSect", pCritSect);
     71    int rc = RTLockValidatorRecExclCreate(&pCritSect->pValidatorRec, NIL_RTLOCKVALIDATORCLASS, 0, "RTCritSect", pCritSect);
    7272    if (RT_SUCCESS(rc))
    7373    {
     
    7575        if (RT_SUCCESS(rc))
    7676            return VINF_SUCCESS;
    77         RTLockValidatorRecDestroy(&pCritSect->pValidatorRec);
     77        RTLockValidatorRecExclDestroy(&pCritSect->pValidatorRec);
    7878    }
    7979
     
    8686
    8787
    88 DECL_FORCE_INLINE(int) rtCritSectTryEnter(PRTCRITSECT pCritSect, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     88DECL_FORCE_INLINE(int) rtCritSectTryEnter(PRTCRITSECT pCritSect, PCRTLOCKVALSRCPOS pSrcPos)
    8989{
    9090    Assert(pCritSect);
     
    137137    return rtCritSectTryEnter(pCritSect, NULL);
    138138#else
    139     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     139    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    140140    return rtCritSectTryEnter(pCritSect, &SrcPos);
    141141#endif
     
    146146RTDECL(int) RTCritSectTryEnterDebug(PRTCRITSECT pCritSect, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    147147{
    148     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     148    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    149149    return rtCritSectTryEnter(pCritSect, &SrcPos);
    150150}
     
    152152
    153153
    154 DECL_FORCE_INLINE(int) rtCritSectEnter(PRTCRITSECT pCritSect, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     154DECL_FORCE_INLINE(int) rtCritSectEnter(PRTCRITSECT pCritSect, PCRTLOCKVALSRCPOS pSrcPos)
    155155{
    156156    Assert(pCritSect);
     
    238238    return rtCritSectEnter(pCritSect, NULL);
    239239#else
    240     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     240    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    241241    return rtCritSectEnter(pCritSect, &SrcPos);
    242242#endif
     
    247247RTDECL(int) RTCritSectEnterDebug(PRTCRITSECT pCritSect, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    248248{
    249     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     249    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    250250    return rtCritSectEnter(pCritSect, &SrcPos);
    251251}
     
    294294
    295295
    296 static int rtCritSectEnterMultiple(size_t cCritSects, PRTCRITSECT *papCritSects, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     296static int rtCritSectEnterMultiple(size_t cCritSects, PRTCRITSECT *papCritSects, PCRTLOCKVALSRCPOS pSrcPos)
    297297{
    298298    Assert(cCritSects > 0);
     
    377377    return rtCritSectEnterMultiple(cCritSects, papCritSects, NULL);
    378378#else
    379     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     379    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    380380    return rtCritSectEnterMultiple(cCritSects, papCritSects, &SrcPos);
    381381#endif
     
    386386RTDECL(int) RTCritSectEnterMultipleDebug(size_t cCritSects, PRTCRITSECT *papCritSects, RTUINTPTR uId, RT_SRC_POS_DECL)
    387387{
    388     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     388    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    389389    return rtCritSectEnterMultiple(cCritSects, papCritSects, &SrcPos);
    390390}
     
    435435    AssertRC(rc);
    436436
    437     RTLockValidatorRecDestroy(&pCritSect->pValidatorRec);
     437    RTLockValidatorRecExclDestroy(&pCritSect->pValidatorRec);
    438438
    439439    return rc;
  • trunk/src/VBox/Runtime/include/internal/lockvalidator.h

    r25602 r25607  
    4141 * Record union for simplifying internal processing.
    4242 */
    43 typedef union RTLOCKVALIDATORRECUNION
     43typedef union RTLOCKVALRECUNION
    4444{
    45     RTLOCKVALIDATORRECCORE      Core;
    46     RTLOCKVALIDATORREC          Excl;
    47     RTLOCKVALIDATORSHARED       Shared;
    48     RTLOCKVALIDATORSHAREDONE    SharedOne;
    49 } RTLOCKVALIDATORRECUNION;
     45    RTLOCKVALRECCORE      Core;
     46    RTLOCKVALRECEXCL      Excl;
     47    RTLOCKVALRECSHRD      Shared;
     48    RTLOCKVALRECSHRDOWN   SharedOwn;
     49} RTLOCKVALRECUNION;
    5050
    5151
     
    5858{
    5959    /** What we're blocking on. */
    60     PRTLOCKVALIDATORRECUNION volatile   pRec;
     60    PRTLOCKVALRECUNION volatile     pRec;
    6161    /** Where we are blocking. */
    62     RTLOCKVALIDATORSRCPOS               SrcPos;
     62    RTLOCKVALSRCPOS                 SrcPos;
    6363    /** Number of registered write locks, mutexes and critsects that this thread owns. */
    64     int32_t volatile                    cWriteLocks;
     64    int32_t volatile                cWriteLocks;
    6565    /** Number of registered read locks that this thread owns, nesting included. */
    66     int32_t volatile                    cReadLocks;
     66    int32_t volatile                cReadLocks;
    6767} RTLOCKVALIDATORPERTHREAD;
    6868
  • trunk/src/VBox/Runtime/include/internal/magics.h

    r25491 r25607  
    6868#define RTLOCALIPCSESSION_MAGIC     0x19530414
    6969/** The magic value for RTLOCKVALIDATORREC::u32Magic. (Vladimir Vladimirovich Nabokov) */
    70 #define RTLOCKVALIDATORREC_MAGIC            0x18990422
     70#define RTLOCKVALRECEXCL_MAGIC      0x18990422
    7171/** The dead magic value for RTLOCKVALIDATORREC::u32Magic. */
    72 #define RTLOCKVALIDATORREC_MAGIC_DEAD      0x19770702
    73 /** The magic value for RTLOCKVALIDATORSHARED::u32Magic. (Agnar Mykle) */
    74 #define RTLOCKVALIDATORSHARED_MAGIC         0x19150808
    75 /** The magic value for RTLOCKVALIDATORSHARED::u32Magic after deletion. */
    76 #define RTLOCKVALIDATORSHARED_MAGIC_DEAD    0x19940115
    77 /** The magic value for RTLOCKVALIDATORSHAREDONE::u32Magic. (Jens Ingvald Bjoerneboe) */
    78 #define RTLOCKVALIDATORSHAREDONE_MAGIC      0x19201009
    79 /** The magic value for RTLOCKVALIDATORSHAREDONE::u32Magic after deletion. */
    80 #define RTLOCKVALIDATORSHAREDONE_MAGIC_DEAD 0x19760509
     72#define RTLOCKVALRECEXCL_MAGIC_DEAD 0x19770702
     73/** The magic value for RTLOCKVALRECSHRD::u32Magic. (Agnar Mykle) */
     74#define RTLOCKVALRECSHRD_MAGIC      0x19150808
     75/** The magic value for RTLOCKVALRECSHRD::u32Magic after deletion. */
     76#define RTLOCKVALRECSHRD_MAGIC_DEAD 0x19940115
     77/** The magic value for RTLOCKVALRECSHRDOWN::u32Magic. (Jens Ingvald Bjoerneboe) */
     78#define RTLOCKVALRECSHRDOWN_MAGIC   0x19201009
     79/** The magic value for RTLOCKVALRECSHRDOWN::u32Magic after deletion. */
     80#define RTLOCKVALRECSHRDOWN_MAGIC_DEAD 0x19760509
    8181/** Magic number for RTMEMCACHEINT::u32Magic. (Joseph Weizenbaum) */
    8282#define RTMEMCACHE_MAGIC            0x19230108
  • trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp

    r25604 r25607  
    8181#ifdef RTSEMMUTEX_STRICT
    8282    /** Lock validator record associated with this mutex. */
    83     RTLOCKVALIDATORREC  ValidatorRec;
     83    RTLOCKVALRECEXCL    ValidatorRec;
    8484#endif
    8585};
     
    120120        pThis->cNesting = 0;
    121121#ifdef RTSEMMUTEX_STRICT
    122         RTLockValidatorRecInit(&pThis->ValidatorRec, NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemMutex", pThis);
     122        RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemMutex", pThis);
    123123#endif
    124124
     
    156156    pThis->cNesting = 0;
    157157#ifdef RTSEMMUTEX_STRICT
    158     RTLockValidatorRecDelete(&pThis->ValidatorRec);
     158    RTLockValidatorRecExclDelete(&pThis->ValidatorRec);
    159159#endif
    160160
     
    167167
    168168
    169 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, bool fAutoResume, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     169DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, bool fAutoResume, PCRTLOCKVALSRCPOS pSrcPos)
    170170{
    171171    /*
     
    310310    int rc = rtSemMutexRequest(MutexSem, cMillies, true, NULL);
    311311#else
    312     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     312    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    313313    int rc = rtSemMutexRequest(MutexSem, cMillies, true, &SrcPos);
    314314#endif
     
    320320RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    321321{
    322     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     322    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    323323    int rc = rtSemMutexRequest(MutexSem, cMillies, true, &SrcPos);
    324324    Assert(rc != VERR_INTERRUPTED);
     
    332332    return rtSemMutexRequest(MutexSem, cMillies, false, NULL);
    333333#else
    334     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     334    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    335335    return rtSemMutexRequest(MutexSem, cMillies, false, &SrcPos);
    336336#endif
     
    340340RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    341341{
    342     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     342    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    343343    return rtSemMutexRequest(MutexSem, cMillies, false, &SrcPos);
    344344}
  • trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp

    r25604 r25607  
    6666#ifdef RTSEMMUTEX_STRICT
    6767    /** Lock validator record associated with this mutex. */
    68     RTLOCKVALIDATORREC  ValidatorRec;
     68    RTLOCKVALRECEXCL    ValidatorRec;
    6969#endif
    7070};
     
    102102                pThis->u32Magic = RTSEMMUTEX_MAGIC;
    103103#ifdef RTSEMMUTEX_STRICT
    104                 RTLockValidatorRecInit(&pThis->ValidatorRec, NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemMutex", pThis);
     104                RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemMutex", pThis);
    105105#endif
    106106
     
    147147    pThis->cNesting = UINT32_MAX;
    148148#ifdef RTSEMMUTEX_STRICT
    149     RTLockValidatorRecDelete(&pThis->ValidatorRec);
     149    RTLockValidatorRecExclDelete(&pThis->ValidatorRec);
    150150#endif
    151151    RTMemTmpFree(pThis);
     
    155155
    156156
    157 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     157DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)
    158158{
    159159    /*
     
    259259    return rtSemMutexRequest(MutexSem, cMillies, NULL);
    260260#else
    261     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     261    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    262262    return rtSemMutexRequest(MutexSem, cMillies, &SrcPos);
    263263#endif
     
    267267RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    268268{
    269     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     269    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    270270    return rtSemMutexRequest(MutexSem, cMillies, &SrcPos);
    271271}
     
    278278    return rtSemMutexRequest(MutexSem, cMillies, NULL);
    279279#else
    280     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     280    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    281281    return rtSemMutexRequest(MutexSem, cMillies, &SrcPos);
    282282#endif
     
    286286RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    287287{
    288     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     288    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    289289    return rtSemMutexRequest(MutexSem, cMillies, &SrcPos);
    290290}
  • trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp

    r25604 r25607  
    8686#ifdef RTSEMRW_STRICT
    8787    /** The validator record for the writer. */
    88     RTLOCKVALIDATORREC      ValidatorWrite;
     88    RTLOCKVALRECEXCL    ValidatorWrite;
    8989    /** The validator record for the readers. */
    90     RTLOCKVALIDATORSHARED   ValidatorRead;
     90    RTLOCKVALRECSHRD    ValidatorRead;
    9191#endif
    9292};
     
    119119                pThis->Writer       = (pthread_t)-1;
    120120#ifdef RTSEMRW_STRICT
    121                 RTLockValidatorRecInit(&pThis->ValidatorWrite, NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemRW", pThis);
    122                 RTLockValidatorSharedRecInit(&pThis->ValidatorRead,  NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemRW", pThis);
    123                 RTLockValidatorMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core);
     121                RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemRW", pThis);
     122                RTLockValidatorRecSharedInit(&pThis->ValidatorRead,  NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemRW", pThis);
     123                RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core);
    124124#endif
    125125                *pRWSem = pThis;
     
    163163    {
    164164#ifdef RTSEMRW_STRICT
    165         RTLockValidatorSharedRecDelete(&pThis->ValidatorRead);
    166         RTLockValidatorRecDelete(&pThis->ValidatorWrite);
     165        RTLockValidatorRecSharedDelete(&pThis->ValidatorRead);
     166        RTLockValidatorRecExclDelete(&pThis->ValidatorWrite);
    167167#endif
    168168        RTMemFree(pThis);
     
    182182RTDECL(int) RTSemRWRequestRead(RTSEMRW RWSem, unsigned cMillies)
    183183{
    184     PRTLOCKVALIDATORSRCPOS pSrcPos = NULL;
     184    PRTLOCKVALSRCPOS pSrcPos = NULL;
    185185
    186186    /*
     
    346346
    347347
    348 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW RWSem, unsigned cMillies, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     348DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW RWSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)
    349349{
    350350    /*
     
    452452    return rtSemRWRequestWrite(RWSem, cMillies, NULL);
    453453#else
    454     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     454    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    455455    return rtSemRWRequestWrite(RWSem, cMillies, &SrcPos);
    456456#endif
     
    460460RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW RWSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    461461{
    462     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     462    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    463463    return rtSemRWRequestWrite(RWSem, cMillies, &SrcPos);
    464464}
     
    471471    return rtSemRWRequestWrite(RWSem, cMillies, NULL);
    472472#else
    473     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     473    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    474474    return rtSemRWRequestWrite(RWSem, cMillies, &SrcPos);
    475475#endif
     
    480480{
    481481    /* EINTR isn't returned by the wait functions we're using. */
    482     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     482    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    483483    return rtSemRWRequestWrite(RWSem, cMillies, &SrcPos);
    484484}
  • trunk/src/VBox/Runtime/r3/win/semmutex-win.cpp

    r25604 r25607  
    6161#ifdef RTSEMMUTEX_STRICT
    6262    /** Lock validator record associated with this mutex. */
    63     RTLOCKVALIDATORREC  ValidatorRec;
     63    RTLOCKVALRECEXCL    ValidatorRec;
    6464#endif
    6565};
     
    8787            pThis->hMtx = hMtx;
    8888#ifdef RTSEMMUTEX_STRICT
    89             RTLockValidatorRecInit(&pThis->ValidatorRec,  NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemMutex", pThis);
     89            RTLockValidatorRecExclInit(&pThis->ValidatorRec,  NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemMutex", pThis);
    9090#endif
    9191            *pMutexSem = pThis;
     
    127127
    128128#ifdef RTSEMMUTEX_STRICT
    129     RTLockValidatorRecDelete(&pThis->ValidatorRec);
     129    RTLockValidatorRecExclDelete(&pThis->ValidatorRec);
    130130#endif
    131131    RTMemFree(pThis);
     
    142142 * @param   pSrcPos             The source position of the caller.
    143143 */
    144 DECL_FORCE_INLINE(int) rtSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     144DECL_FORCE_INLINE(int) rtSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)
    145145{
    146146    /*
     
    205205    return rtSemMutexRequestNoResume(MutexSem, cMillies, NULL);
    206206#else
    207     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     207    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    208208    return rtSemMutexRequestNoResume(MutexSem, cMillies, &SrcPos);
    209209#endif
     
    213213RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    214214{
    215     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     215    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    216216    return rtSemMutexRequestNoResume(MutexSem, cMillies, &SrcPos);
    217217}
  • trunk/src/VBox/VMM/PDMCritSect.cpp

    r25491 r25607  
    127127    if (RT_SUCCESS(rc))
    128128    {
    129         rc = RTLockValidatorRecCreate(&pCritSect->Core.pValidatorRec, NIL_RTLOCKVALIDATORCLASS, 0, pszName, pCritSect);
     129        rc = RTLockValidatorRecExclCreate(&pCritSect->Core.pValidatorRec, NIL_RTLOCKVALIDATORCLASS, 0, pszName, pCritSect);
    130130        if (RT_SUCCESS(rc))
    131131        {
     
    245245    int rc = SUPSemEventClose(pVM->pSession, hEvent);
    246246    AssertRC(rc);
    247     RTLockValidatorRecDestroy(&pCritSect->Core.pValidatorRec);
     247    RTLockValidatorRecExclDestroy(&pCritSect->Core.pValidatorRec);
    248248    pCritSect->pNext   = NULL;
    249249    pCritSect->pvKey   = NULL;
     
    396396
    397397#ifdef PDMCRITSECT_STRICT
    398     RTLOCKVALIDATORSRCPOS const SrcPos = pCritSect->s.Core.pValidatorRec->SrcPos;
     398    RTLOCKVALSRCPOS const SrcPos = pCritSect->s.Core.pValidatorRec->SrcPos;
    399399#endif
    400400    PDMCritSectLeave(pCritSect);
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r25478 r25607  
    8888 * @param   hNativeSelf     The native handle of this thread.
    8989 */
    90 DECL_FORCE_INLINE(int) pdmCritSectEnterFirst(PPDMCRITSECT pCritSect, RTNATIVETHREAD hNativeSelf, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     90DECL_FORCE_INLINE(int) pdmCritSectEnterFirst(PPDMCRITSECT pCritSect, RTNATIVETHREAD hNativeSelf, PCRTLOCKVALSRCPOS pSrcPos)
    9191{
    9292    AssertMsg(pCritSect->s.Core.NativeThreadOwner == NIL_RTNATIVETHREAD, ("NativeThreadOwner=%p\n", pCritSect->s.Core.NativeThreadOwner));
     
    113113 * @param   hNativeSelf         The native thread handle.
    114114 */
    115 static int pdmR3CritSectEnterContended(PPDMCRITSECT pCritSect, RTNATIVETHREAD hNativeSelf, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     115static int pdmR3CritSectEnterContended(PPDMCRITSECT pCritSect, RTNATIVETHREAD hNativeSelf, PCRTLOCKVALSRCPOS pSrcPos)
    116116{
    117117    /*
     
    170170 *                              and the section is busy.
    171171 */
    172 DECL_FORCE_INLINE(int) pdmCritSectEnter(PPDMCRITSECT pCritSect, int rcBusy, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     172DECL_FORCE_INLINE(int) pdmCritSectEnter(PPDMCRITSECT pCritSect, int rcBusy, PCRTLOCKVALSRCPOS pSrcPos)
    173173{
    174174    Assert(pCritSect->s.Core.cNestings < 8);  /* useful to catch incorrect locking */
     
    248248    return pdmCritSectEnter(pCritSect, rcBusy, NULL);
    249249#else
    250     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     250    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    251251    return pdmCritSectEnter(pCritSect, rcBusy, &SrcPos);
    252252#endif
     
    275275{
    276276#ifdef PDMCRITSECT_STRICT
    277     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     277    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    278278    return pdmCritSectEnter(pCritSect, rcBusy, &SrcPos);
    279279#else
     
    293293 * @param   pCritSect   The critical section.
    294294 */
    295 static int pdmCritSectTryEnter(PPDMCRITSECT pCritSect, PCRTLOCKVALIDATORSRCPOS pSrcPos)
     295static int pdmCritSectTryEnter(PPDMCRITSECT pCritSect, PCRTLOCKVALSRCPOS pSrcPos)
    296296{
    297297    /*
     
    349349    return pdmCritSectTryEnter(pCritSect, NULL);
    350350#else
    351     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API();
     351    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    352352    return pdmCritSectTryEnter(pCritSect, &SrcPos);
    353353#endif
     
    375375{
    376376#ifdef PDMCRITSECT_STRICT
    377     RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API();
     377    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    378378    return pdmCritSectTryEnter(pCritSect, &SrcPos);
    379379#else
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