VirtualBox

Changeset 25704 in vbox


Ignore:
Timestamp:
Jan 10, 2010 8:12:30 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56439
Message:

iprt,pdmcritsect: More flexible lock naming, added RTCritSectSetSubClass and made some RTCritSectInitEx.

Location:
trunk
Files:
19 edited

Legend:

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

    r25685 r25704  
    125125 *                              order inside the same class.  If you don't know,
    126126 *                              then pass RTLOCKVAL_SUB_CLASS_NONE.
    127  * @param   pszName             The lock name (optional).
     127 * @param   pszNameFmt          Name format string for the lock validator,
     128 *                              optional (NULL). Max length is 32 bytes.
     129 * @param   ...                 Format string arguments.
    128130 */
    129131RTDECL(int) RTCritSectInitEx(PRTCRITSECT pCritSect, uint32_t fFlags,
    130                              RTLOCKVALCLASS hClass, uint32_t uSubClass, const char *pszName);
     132                             RTLOCKVALCLASS hClass, uint32_t uSubClass, const char *pszName, ...);
     133
     134/**
     135 * Changes the lock validator sub-class of the critical section.
     136 *
     137 * It is recommended to try make sure that nobody is using this critical section
     138 * while changing the value.
     139 *
     140 * @returns The old sub-class.  RTLOCKVAL_SUB_CLASS_INVALID is returns if the
     141 *          lock validator isn't compiled in or either of the parameters are
     142 *          invalid.
     143 * @param   pCritSect           The critical section.
     144 * @param   uSubClass           The new sub-class value.
     145 */
     146RTDECL(uint32_t) RTCritSectSetSubClass(PRTCRITSECT pCritSect, uint32_t uSubClass);
    131147
    132148/**
  • trunk/include/iprt/lockvalidator.h

    r25703 r25704  
    153153    /** Pointer to the lock. */
    154154    RTHCPTR                             hLock;
    155     /** The lock name. */
    156     R3R0PTRTYPE(const char *)           pszName;
    157155    /** Pointer to the next sibling record.
    158156     * This is used to find the read side of a read-write lock.  */
    159157    R3R0PTRTYPE(PRTLOCKVALRECUNION)     pSibling;
     158    /** The lock name.
     159     * @remarks The bytes beyond 32 are for better size alignment and can be
     160     *          taken and used for other purposes if it becomes necessary. */
     161    char                                szName[32 + (HC_ARCH_BITS == 32 ? 12 : 8)];
    160162} RTLOCKVALRECEXCL;
    161 AssertCompileSize(RTLOCKVALRECEXCL, HC_ARCH_BITS == 32 ? 8 + 16 + 32 : 8 + 32 + 56);
     163AssertCompileSize(RTLOCKVALRECEXCL, HC_ARCH_BITS == 32 ? 0x60 : 0x80);
    162164/* The pointer type is defined in iprt/types.h. */
    163165
     
    208210    /** Pointer to the lock. */
    209211    RTHCPTR                             hLock;
    210     /** The lock name. */
    211     R3R0PTRTYPE(const char *)           pszName;
    212212    /** Pointer to the next sibling record.
    213213     * This is used to find the write side of a read-write lock.  */
     
    234234    /** Pointer to a table containing pointers to records of all the owners. */
    235235    R3R0PTRTYPE(PRTLOCKVALRECSHRDOWN volatile *) papOwners;
    236 #if HC_ARCH_BITS == 32
    237     /** Alignment padding. */
    238     uint32_t                            u32Alignment;
    239 #endif
     236
     237    /** The lock name.
     238     * @remarks The bytes beyond 32 are for better size alignment and can be
     239     *          taken and used for other purposes if it becomes necessary. */
     240    char                                szName[32 + (HC_ARCH_BITS == 32 ? 8 : 8)];
    240241} RTLOCKVALRECSHRD;
    241 AssertCompileSize(RTLOCKVALRECSHRD, HC_ARCH_BITS == 32 ? 24 + 20 + 4 : 40 + 24);
     242AssertCompileSize(RTLOCKVALRECSHRD, HC_ARCH_BITS == 32 ? 0x50 : 0x60);
    242243
    243244
     
    264265 *                              order inside the same class.  If you don't know,
    265266 *                              then pass RTLOCKVAL_SUB_CLASS_NONE.
    266  * @param   pszName             The lock name (optional).
    267267 * @param   hLock               The lock handle.
    268268 * @param   fEnabled            Pass @c false to explicitly disable lock
    269269 *                              validation, otherwise @c true.
     270 * @param   pszNameFmt          Name format string for the lock validator,
     271 *                              optional (NULL). Max length is 32 bytes.
     272 * @param   ...                 Format string arguments.
    270273 */
    271274RTDECL(void) RTLockValidatorRecExclInit(PRTLOCKVALRECEXCL pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
    272                                         const char *pszName, void *hLock, bool fEnabled);
     275                                        void *hLock, bool fEnabled, const char *pszNameFmt, ...);
     276/**
     277 * Initialize a lock validator record.
     278 *
     279 * Use RTLockValidatorRecExclDelete to deinitialize it.
     280 *
     281 * @param   pRec                The record.
     282 * @param   hClass              The class (no reference consumed). If NIL, the
     283 *                              no lock order validation will be performed on
     284 *                              this lock.
     285 * @param   uSubClass           The sub-class.  This is used to define lock
     286 *                              order inside the same class.  If you don't know,
     287 *                              then pass RTLOCKVAL_SUB_CLASS_NONE.
     288 * @param   hLock               The lock handle.
     289 * @param   fEnabled            Pass @c false to explicitly disable lock
     290 *                              validation, otherwise @c true.
     291 * @param   pszNameFmt          Name format string for the lock validator,
     292 *                              optional (NULL). Max length is 32 bytes.
     293 * @param   va                  Format string arguments.
     294 */
     295RTDECL(void) RTLockValidatorRecExclInitV(PRTLOCKVALRECEXCL pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
     296                                         void *hLock, bool fEnabled, const char *pszNameFmt, va_list va);
    273297/**
    274298 * Uninitialize a lock validator record previously initialized by
     
    293317 *                              order inside the same class.  If you don't know,
    294318 *                              then pass RTLOCKVAL_SUB_CLASS_NONE.
    295  * @param   pszName             The lock name (optional).
    296319 * @param   hLock               The lock handle.
    297320 * @param   fEnabled            Pass @c false to explicitly disable lock
    298321 *                              validation, otherwise @c true.
     322 * @param   pszNameFmt          Name format string for the lock validator,
     323 *                              optional (NULL). Max length is 32 bytes.
     324 * @param   ...                 Format string arguments.
    299325 */
    300326RTDECL(int)  RTLockValidatorRecExclCreate(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
    301                                           const char *pszName, void *hLock, bool fEnabled);
     327                                          void *hLock, bool fEnabled, const char *pszNameFmt, ...);
     328
     329/**
     330 * Create and initialize a lock validator record.
     331 *
     332 * Use RTLockValidatorRecExclDestroy to deinitialize and destroy the returned
     333 * record.
     334 *
     335 * @return VINF_SUCCESS or VERR_NO_MEMORY.
     336 * @param   ppRec               Where to return the record pointer.
     337 * @param   hClass              The class (no reference consumed). If NIL, the
     338 *                              no lock order validation will be performed on
     339 *                              this lock.
     340 * @param   uSubClass           The sub-class.  This is used to define lock
     341 *                              order inside the same class.  If you don't know,
     342 *                              then pass RTLOCKVAL_SUB_CLASS_NONE.
     343 * @param   hLock               The lock handle.
     344 * @param   fEnabled            Pass @c false to explicitly disable lock
     345 *                              validation, otherwise @c true.
     346 * @param   pszNameFmt          Name format string for the lock validator,
     347 *                              optional (NULL). Max length is 32 bytes.
     348 * @param   va                  Format string arguments.
     349 */
     350RTDECL(int)  RTLockValidatorRecExclCreateV(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
     351                                           void *hLock, bool fEnabled, const char *pszNameFmt, va_list va);
    302352
    303353/**
     
    308358 */
    309359RTDECL(void) RTLockValidatorRecExclDestroy(PRTLOCKVALRECEXCL *ppRec);
     360
     361/**
     362 * Sets the sub-class of the record.
     363 *
     364 * It is recommended to try make sure that nobody is using this class while
     365 * changing the value.
     366 *
     367 * @returns The old sub-class.  RTLOCKVAL_SUB_CLASS_INVALID is returns if the
     368 *          lock validator isn't compiled in or either of the parameters are
     369 *          invalid.
     370 * @param   pRec                The validator record.
     371 * @param   uSubClass           The new sub-class value.
     372 */
     373RTDECL(uint32_t) RTLockValidatorRecExclSetSubClass(PRTLOCKVALRECEXCL pRec, uint32_t uSubClass);
    310374
    311375/**
     
    497561 *                              order inside the same class.  If you don't know,
    498562 *                              then pass RTLOCKVAL_SUB_CLASS_NONE.
    499  * @param   pszName             The lock name (optional).
    500563 * @param   hLock               The lock handle.
    501564 * @param   fSignaller          Set if event semaphore signaller logic should be
     
    504567 * @param   fEnabled            Pass @c false to explicitly disable lock
    505568 *                              validation, otherwise @c true.
     569 * @param   pszNameFmt          Name format string for the lock validator,
     570 *                              optional (NULL). Max length is 32 bytes.
     571 * @param   ...                 Format string arguments.
    506572 */
    507573RTDECL(void) RTLockValidatorRecSharedInit(PRTLOCKVALRECSHRD pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
    508                                           const char *pszName, void *hLock, bool fSignaller, bool fEnabled);
     574                                          void *hLock, bool fSignaller, bool fEnabled, const char *pszNameFmt, ...);
     575/**
     576 * Initialize a lock validator record for a shared lock.
     577 *
     578 * Use RTLockValidatorRecSharedDelete to deinitialize it.
     579 *
     580 * @param   pRec                The shared lock record.
     581 * @param   hClass              The class (no reference consumed). If NIL, the
     582 *                              no lock order validation will be performed on
     583 *                              this lock.
     584 * @param   uSubClass           The sub-class.  This is used to define lock
     585 *                              order inside the same class.  If you don't know,
     586 *                              then pass RTLOCKVAL_SUB_CLASS_NONE.
     587 * @param   hLock               The lock handle.
     588 * @param   fSignaller          Set if event semaphore signaller logic should be
     589 *                              applied to this record, clear if read-write
     590 *                              semaphore logic should be used.
     591 * @param   fEnabled            Pass @c false to explicitly disable lock
     592 *                              validation, otherwise @c true.
     593 * @param   pszNameFmt          Name format string for the lock validator,
     594 *                              optional (NULL). Max length is 32 bytes.
     595 * @param   va                  Format string arguments.
     596 */
     597RTDECL(void) RTLockValidatorRecSharedInitV(PRTLOCKVALRECSHRD pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
     598                                           void *hLock, bool fSignaller, bool fEnabled, const char *pszNameFmt, va_list va);
    509599/**
    510600 * Uninitialize a lock validator record previously initialized by
     
    790880 * @param   iLine               The source position of the call, line.
    791881 * @param   pszFunction         The source position of the call, function.
    792  */
    793 RTDECL(int) RTLockValidatorClassCreate(PRTLOCKVALCLASS phClass, bool fAutodidact, RT_SRC_POS_DECL);
     882 * @param   pszNameFmt          Class name format string, optional (NULL).  Max
     883 *                              length is 32 bytes.
     884 * @param   ...                 Format string arguments.
     885 */
     886RTDECL(int) RTLockValidatorClassCreate(PRTLOCKVALCLASS phClass, bool fAutodidact, RT_SRC_POS_DECL, const char *pszNameFmt, ...);
    794887
    795888/**
  • trunk/include/iprt/types.h

    r25692 r25704  
    15001500 * taking in ascending order.
    15011501 * @{ */
     1502/** Invalid value.  */
     1503#define RTLOCKVAL_SUB_CLASS_INVALID     UINT32_C(0)
    15021504/** Not allowed to be taken with any other locks in the same class.
    15031505  * This is the recommended value.  */
    1504 #define RTLOCKVAL_SUB_CLASS_NONE        UINT32_C(0)
     1506#define RTLOCKVAL_SUB_CLASS_NONE        UINT32_C(1)
    15051507/** Any order is allowed within the class. */
    1506 #define RTLOCKVAL_SUB_CLASS_ANY         UINT32_C(1)
     1508#define RTLOCKVAL_SUB_CLASS_ANY         UINT32_C(2)
    15071509/** The first user value. */
    15081510#define RTLOCKVAL_SUB_CLASS_USER        UINT32_C(16)
  • trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp

    r25703 r25704  
    509509#else
    510510            RTAssertMsg2AddWeak("%s%p %s own=%s nest=%u pos={%Rbn(%u) %Rfn %p}%s%s", pszPrefix,
    511                                 pRec->Excl.hLock, pRec->Excl.pszName,
     511                                pRec->Excl.hLock, pRec->Excl.szName,
    512512                                rtLockValidatorNameThreadHandle(&pRec->Excl.hThread), cRecursion,
    513513                                pSrcPos->pszFile, pSrcPos->uLine, pSrcPos->pszFunction, pSrcPos->uId,
     
    518518        case RTLOCKVALRECSHRD_MAGIC:
    519519            RTAssertMsg2AddWeak("%s%p %s srec=%p%s", pszPrefix,
    520                                 pRec->Shared.hLock, pRec->Shared.pszName, pRec,
     520                                pRec->Shared.hLock, pRec->Shared.szName, pRec,
    521521                                pszSuffix);
    522522            break;
     
    535535#else
    536536                RTAssertMsg2AddWeak("%s%p %s thr=%s nest=%u pos={%Rbn(%u) %Rfn %p}%s%s", pszPrefix,
    537                                     pShared->hLock, pShared->pszName,
     537                                    pShared->hLock, pShared->szName,
    538538                                    rtLockValidatorNameThreadHandle(&pRec->ShrdOwner.hThread), cRecursion,
    539539                                    pSrcPos->pszFile, pSrcPos->uLine, pSrcPos->pszFunction, pSrcPos->uId,
     
    10241024
    10251025
    1026 RTDECL(int) RTLockValidatorClassCreate(PRTLOCKVALCLASS phClass, bool fAutodidact, RT_SRC_POS_DECL)
     1026RTDECL(int) RTLockValidatorClassCreate(PRTLOCKVALCLASS phClass, bool fAutodidact, RT_SRC_POS_DECL, const char *pszNameFmt, ...)
    10271027{
    10281028    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_POS_NO_ID();
    1029     return RTLockValidatorClassCreateEx(phClass, &SrcPos,
    1030                                         fAutodidact, true /*fRecursionOk*/, false /*fStrictReleaseOrder*/,
    1031                                         1 /*cMsMinDeadlock*/, 1 /*cMsMinOrder*/,
    1032                                         NULL /*pszName*/);
     1029    va_list va;
     1030    va_start(va, pszNameFmt);
     1031    int rc = RTLockValidatorClassCreateExV(phClass, &SrcPos,
     1032                                           fAutodidact, true /*fRecursionOk*/, false /*fStrictReleaseOrder*/,
     1033                                           1 /*cMsMinDeadlock*/, 1 /*cMsMinOrder*/,
     1034                                           pszNameFmt, va);
     1035    va_end(va);
     1036    return rc;
    10331037}
    10341038
     
    14561460    {
    14571461        case RTLOCKVALRECEXCL_MAGIC:
    1458             return pRec->Excl.pszName;
     1462            return pRec->Excl.szName;
    14591463        case RTLOCKVALRECSHRD_MAGIC:
    1460             return pRec->Shared.pszName;
     1464            return pRec->Shared.szName;
    14611465        case RTLOCKVALRECSHRDOWN_MAGIC:
    1462             return pRec->ShrdOwner.pSharedRec ? pRec->ShrdOwner.pSharedRec->pszName : "orphaned";
     1466            return pRec->ShrdOwner.pSharedRec ? pRec->ShrdOwner.pSharedRec->szName : "orphaned";
    14631467        case RTLOCKVALRECNEST_MAGIC:
    14641468            pRec = rtLockValidatorReadRecUnionPtr(&pRec->Nest.pRec);
     
    14681472                {
    14691473                    case RTLOCKVALRECEXCL_MAGIC:
    1470                         return pRec->Excl.pszName;
     1474                        return pRec->Excl.szName;
    14711475                    case RTLOCKVALRECSHRD_MAGIC:
    1472                         return pRec->Shared.pszName;
     1476                        return pRec->Shared.szName;
    14731477                    case RTLOCKVALRECSHRDOWN_MAGIC:
    1474                         return pRec->ShrdOwner.pSharedRec ? pRec->ShrdOwner.pSharedRec->pszName : "orphaned";
     1478                        return pRec->ShrdOwner.pSharedRec ? pRec->ShrdOwner.pSharedRec->szName : "orphaned";
    14751479                    default:
    14761480                        return "unknown-nested";
     
    27982802
    27992803
    2800 RTDECL(void) RTLockValidatorRecExclInit(PRTLOCKVALRECEXCL pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
    2801                                         const char *pszName, void *hLock, bool fEnabled)
     2804RTDECL(void) RTLockValidatorRecExclInitV(PRTLOCKVALRECEXCL pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
     2805                                         void *hLock, bool fEnabled, const char *pszNameFmt, va_list va)
    28022806{
    28032807    RTLOCKVAL_ASSERT_PTR_ALIGN(pRec);
     
    28162820    pRec->cRecursion    = 0;
    28172821    pRec->hLock         = hLock;
    2818     pRec->pszName       = pszName;
    28192822    pRec->pSibling      = NULL;
     2823    if (pszNameFmt)
     2824        RTStrPrintfV(pRec->szName, sizeof(pRec->szName), pszNameFmt, va);
     2825    else
     2826    {
     2827        static uint32_t volatile s_cAnonymous = 0;
     2828        uint32_t i = ASMAtomicIncU32(&s_cAnonymous) - 1;
     2829        RTStrPrintf(pRec->szName, sizeof(pRec->szName), "anon-excl-%u", i);
     2830    }
    28202831
    28212832    /* Lazy initialization. */
     
    28252836
    28262837
    2827 RTDECL(int)  RTLockValidatorRecExclCreate(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALCLASS hClass,
    2828                                           uint32_t uSubClass, const char *pszName, void *pvLock, bool fEnabled)
     2838RTDECL(void) RTLockValidatorRecExclInit(PRTLOCKVALRECEXCL pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
     2839                                        void *hLock, bool fEnabled, const char *pszNameFmt, ...)
     2840{
     2841    va_list va;
     2842    va_start(va, pszNameFmt);
     2843    RTLockValidatorRecExclInitV(pRec, hClass, uSubClass, hLock, fEnabled, pszNameFmt, va);
     2844    va_end(va);
     2845}
     2846
     2847
     2848RTDECL(int)  RTLockValidatorRecExclCreateV(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALCLASS hClass,
     2849                                           uint32_t uSubClass, void *pvLock, bool fEnabled,
     2850                                           const char *pszNameFmt, va_list va)
    28292851{
    28302852    PRTLOCKVALRECEXCL pRec;
     
    28322854    if (!pRec)
    28332855        return VERR_NO_MEMORY;
    2834 
    2835     RTLockValidatorRecExclInit(pRec, hClass, uSubClass, pszName, pvLock, fEnabled);
    2836 
     2856    RTLockValidatorRecExclInitV(pRec, hClass, uSubClass, pvLock, fEnabled, pszNameFmt, va);
    28372857    return VINF_SUCCESS;
     2858}
     2859
     2860
     2861RTDECL(int)  RTLockValidatorRecExclCreate(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALCLASS hClass,
     2862                                          uint32_t uSubClass, void *pvLock, bool fEnabled,
     2863                                          const char *pszNameFmt, ...)
     2864{
     2865    va_list va;
     2866    va_start(va, pszNameFmt);
     2867    int rc = RTLockValidatorRecExclCreateV(ppRec, hClass, uSubClass, pvLock, fEnabled, pszNameFmt, va);
     2868    va_end(va);
     2869    return rc;
    28382870}
    28392871
     
    28662898        RTMemFree(pRec);
    28672899    }
     2900}
     2901
     2902
     2903RTDECL(uint32_t) RTLockValidatorRecExclSetSubClass(PRTLOCKVALRECEXCL pRec, uint32_t uSubClass)
     2904{
     2905    AssertPtrReturn(pRec, RTLOCKVAL_SUB_CLASS_INVALID);
     2906    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECEXCL_MAGIC, RTLOCKVAL_SUB_CLASS_INVALID);
     2907    AssertReturn(   uSubClass >= RTLOCKVAL_SUB_CLASS_USER
     2908                 || uSubClass == RTLOCKVAL_SUB_CLASS_NONE
     2909                 || uSubClass == RTLOCKVAL_SUB_CLASS_ANY,
     2910                 RTLOCKVAL_SUB_CLASS_INVALID);
     2911    return ASMAtomicXchgU32(&pRec->uSubClass, uSubClass);
    28682912}
    28692913
     
    31803224
    31813225
    3182 RTDECL(void) RTLockValidatorRecSharedInit(PRTLOCKVALRECSHRD pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
    3183                                           const char *pszName, void *hLock, bool fSignaller, bool fEnabled)
     3226RTDECL(void) RTLockValidatorRecSharedInitV(PRTLOCKVALRECSHRD pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
     3227                                           void *hLock, bool fSignaller, bool fEnabled, const char *pszNameFmt, va_list va)
    31843228{
    31853229    RTLOCKVAL_ASSERT_PTR_ALIGN(pRec);
     
    31903234    pRec->hClass        = rtLockValidatorClassValidateAndRetain(hClass);
    31913235    pRec->hLock         = hLock;
    3192     pRec->pszName       = pszName;
    31933236    pRec->fEnabled      = fEnabled && RTLockValidatorIsEnabled();
    31943237    pRec->fSignaller    = fSignaller;
     
    32023245    pRec->fPadding      = false;
    32033246    pRec->papOwners     = NULL;
    3204 #if HC_ARCH_BITS == 32
    3205     pRec->u32Alignment  = UINT32_MAX;
    3206 #endif
     3247
     3248    /* the name */
     3249    if (pszNameFmt)
     3250        RTStrPrintfV(pRec->szName, sizeof(pRec->szName), pszNameFmt, va);
     3251    else
     3252    {
     3253        static uint32_t volatile s_cAnonymous = 0;
     3254        uint32_t i = ASMAtomicIncU32(&s_cAnonymous) - 1;
     3255        RTStrPrintf(pRec->szName, sizeof(pRec->szName), "anon-shrd-%u", i);
     3256    }
     3257}
     3258
     3259
     3260RTDECL(void) RTLockValidatorRecSharedInit(PRTLOCKVALRECSHRD pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass,
     3261                                          void *hLock, bool fSignaller, bool fEnabled, const char *pszNameFmt, ...)
     3262{
     3263    va_list va;
     3264    va_start(va, pszNameFmt);
     3265    RTLockValidatorRecSharedInitV(pRec, hClass, uSubClass, hLock, fSignaller, fEnabled, pszNameFmt, va);
     3266    va_end(va);
    32073267}
    32083268
  • trunk/src/VBox/Runtime/generic/critsect-generic.cpp

    r25685 r25704  
    5353
    5454
    55 RTDECL(int) RTCritSectInitEx(PRTCRITSECT pCritSect, uint32_t fFlags, RTLOCKVALCLASS hClass, uint32_t uSubClass, const char *pszName)
     55RTDECL(int) RTCritSectInitEx(PRTCRITSECT pCritSect, uint32_t fFlags, RTLOCKVALCLASS hClass, uint32_t uSubClass,
     56                             const char *pszNameFmt, ...)
    5657{
    5758    AssertReturn(fFlags <= (RTCRITSECT_FLAGS_NO_NESTING | RTCRITSECT_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
     
    6566    pCritSect->cLockers             = -1;
    6667    pCritSect->NativeThreadOwner    = NIL_RTNATIVETHREAD;
    67     int rc = RTLockValidatorRecExclCreate(&pCritSect->pValidatorRec, hClass, uSubClass, pszName,
    68                                           pCritSect, !(fFlags & RTCRITSECT_FLAGS_NO_LOCK_VAL));
     68#ifndef RTCRITSECT_STRICT
     69    pCritSect->pValidatorRec        = NULL;
     70    int rc = VINF_SUCCESS;
     71#else
     72    va_list va;
     73    va_start(va, pszNameFmt);
     74    int rc = RTLockValidatorRecExclCreateV(&pCritSect->pValidatorRec, hClass, uSubClass, pCritSect,
     75                                           !(fFlags & RTCRITSECT_FLAGS_NO_LOCK_VAL), pszNameFmt, va);
     76    va_end(va);
     77#endif
    6978    if (RT_SUCCESS(rc))
    7079    {
     
    8190}
    8291RT_EXPORT_SYMBOL(RTCritSectInitEx);
     92
     93
     94RTDECL(uint32_t) RTCritSectSetSubClass(PRTCRITSECT pCritSect, uint32_t uSubClass)
     95{
     96#ifdef RTCRITSECT_STRICT
     97    AssertPtrReturn(pCritSect, RTLOCKVAL_SUB_CLASS_INVALID);
     98    AssertReturn(pCritSect->u32Magic == RTCRITSECT_MAGIC, RTLOCKVAL_SUB_CLASS_INVALID);
     99    return RTLockValidatorRecExclSetSubClass(pCritSect->pValidatorRec, uSubClass);
     100#else
     101    return RTLOCKVAL_SUB_CLASS_INVALID;
     102#endif
     103}
    83104
    84105
  • trunk/src/VBox/Runtime/generic/semrw-generic.cpp

    r25685 r25704  
    135135                        pThis->u32Magic             = RTSEMRW_MAGIC;
    136136#ifdef RTSEMRW_STRICT
    137                         RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, true);
    138                         RTLockValidatorRecSharedInit(&pThis->ValidatorRead, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, false /*fSignaller*/, true);
     137                        RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     138                                                   true /*fEnabled*/, "RTSemRW");
     139                        RTLockValidatorRecSharedInit(&pThis->ValidatorRead, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     140                                                     false /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    139141                        RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core);
    140142#endif
  • trunk/src/VBox/Runtime/generic/semrw-lockless-generic.cpp

    r25685 r25704  
    134134            pThis->fNeedReset           = false;
    135135#ifdef RTSEMRW_STRICT
    136             RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, true);
    137             RTLockValidatorRecSharedInit(&pThis->ValidatorRead,  NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, false /*fSignaller*/, true);
     136            RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     137                                       true /*fEnabled*/, "RTSemRW");
     138            RTLockValidatorRecSharedInit(&pThis->ValidatorRead,  NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     139                                         false /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    138140            RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core);
    139141#endif
  • trunk/src/VBox/Runtime/r3/linux/semevent-linux.cpp

    r25685 r25704  
    131131        RTLockValidatorRecSharedInit(&pThis->Signallers,
    132132                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
    133                                      "RTSemEvent", pThis, true /*fSignaller*/, true);
     133                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    134134        pThis->fEverHadSignallers = false;
    135135#endif
  • trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp

    r25688 r25704  
    132132        RTLockValidatorRecSharedInit(&pThis->Signallers,
    133133                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
    134                                      "RTSemEventMulti", pThis, true /*fSignaller*/, true);
     134                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    135135        pThis->fEverHadSignallers = false;
    136136#endif
  • trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp

    r25685 r25704  
    120120        pThis->cNesting = 0;
    121121#ifdef RTSEMMUTEX_STRICT
    122         RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemMutex", pThis, true);
     122        RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     123                                   true /*fEnabled*/, "RTSemMutex");
    123124#endif
    124125
  • trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp

    r25685 r25704  
    134134                        RTLockValidatorRecSharedInit(&pThis->Signallers,
    135135                                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
    136                                                      "RTSemEvent", pThis, true /*fSignaller*/, true);
     136                                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    137137                        pThis->fEverHadSignallers = false;
    138138#endif
  • trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp

    r25685 r25704  
    124124                        RTLockValidatorRecSharedInit(&pThis->Signallers,
    125125                                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
    126                                                      "RTSemEventMulti", pThis, true /*fSignaller*/, true);
     126                                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    127127                        pThis->fEverHadSignallers = false;
    128128#endif
  • trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp

    r25685 r25704  
    102102                pThis->u32Magic = RTSEMMUTEX_MAGIC;
    103103#ifdef RTSEMMUTEX_STRICT
    104                 RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemMutex", pThis, true);
     104                RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     105                                           true /*fEnabled*/, "RTSemMutex");
    105106#endif
    106107
  • trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp

    r25685 r25704  
    126126                pThis->Writer       = (pthread_t)-1;
    127127#ifdef RTSEMRW_STRICT
    128                 RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, true);
    129                 RTLockValidatorRecSharedInit(&pThis->ValidatorRead, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, false /*fSignaller*/, true);
     128                RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     129                                           true /*fEnabled*/, "RTSemRW");
     130                RTLockValidatorRecSharedInit(&pThis->ValidatorRead, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     131                                             false /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    130132                RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core);
    131133#endif
  • trunk/src/VBox/Runtime/r3/win/semevent-win.cpp

    r25685 r25704  
    8989        RTLockValidatorRecSharedInit(&pThis->Signallers,
    9090                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
    91                                      "RTSemEvent", pThis, true /*fSignaller*/, true);
     91                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    9292        pThis->fEverHadSignallers = false;
    9393#endif
  • trunk/src/VBox/Runtime/r3/win/semeventmulti-win.cpp

    r25685 r25704  
    9292        RTLockValidatorRecSharedInit(&pThis->Signallers,
    9393                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
    94                                      "RTSemEvent", pThis, true /*fSignaller*/, true);
     94                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
    9595        pThis->fEverHadSignallers = false;
    9696#endif
  • trunk/src/VBox/Runtime/r3/win/semmutex-win.cpp

    r25685 r25704  
    9393            pThis->cRecursions  = 0;
    9494#ifdef RTSEMMUTEX_STRICT
    95             RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemMutex", pThis, true);
     95            RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis,
     96                                       true /*fEnabled*/, "RTSemMutex");
    9697#endif
    9798            *pMutexSem = pThis;
  • trunk/src/VBox/Runtime/testcase/tstRTLockValidator.cpp

    r25703 r25704  
    456456static void testDd1(uint32_t cThreads, uint32_t cSecs)
    457457{
    458     testIt(cThreads, cSecs, false, testDd1Thread, "critsect");
     458    testIt(cThreads, cSecs, false, testDd1Thread, "deadlock, critsect");
    459459}
    460460
     
    512512static void testDd2(uint32_t cThreads, uint32_t cSecs)
    513513{
    514     testIt(cThreads, cSecs, false, testDd2Thread, "read-write");
     514    testIt(cThreads, cSecs, false, testDd2Thread, "deadlock, read-write");
    515515}
    516516
     
    559559static void testDd3(uint32_t cThreads, uint32_t cSecs)
    560560{
    561     testIt(cThreads, cSecs, true, testDd3Thread, "read-write race");
     561    testIt(cThreads, cSecs, true, testDd3Thread, "deadlock, read-write race");
    562562}
    563563
     
    615615static void testDd4(uint32_t cThreads, uint32_t cSecs)
    616616{
    617     testIt(cThreads, cSecs, true, testDd4Thread, "read-write race v2");
     617    testIt(cThreads, cSecs, true, testDd4Thread, "deadlock, read-write race v2");
    618618}
    619619
     
    655655static void testDd5(uint32_t cThreads, uint32_t cSecs)
    656656{
    657     testIt(cThreads, cSecs, false, testDd5Thread, "mutex");
     657    testIt(cThreads, cSecs, false, testDd5Thread, "deadlock, mutex");
    658658}
    659659
     
    708708static void testDd6(uint32_t cThreads, uint32_t cSecs)
    709709{
    710     testIt(cThreads, cSecs, false, testDd6Thread, "event");
     710    testIt(cThreads, cSecs, false, testDd6Thread, "deadlock, event");
    711711}
    712712
     
    762762static void testDd7(uint32_t cThreads, uint32_t cSecs)
    763763{
    764     testIt(cThreads, cSecs, false, testDd7Thread, "event multi");
     764    testIt(cThreads, cSecs, false, testDd7Thread, "deadlock, event multi");
    765765}
    766766
     
    776776        if (i <= 3)
    777777        {
    778             RTTEST_CHECK_RC_RETV(g_hTest, RTLockValidatorClassCreate(&g_ahClasses[i], true /*fAutodidact*/, RT_SRC_POS), VINF_SUCCESS);
     778            RTTEST_CHECK_RC_RETV(g_hTest, RTLockValidatorClassCreate(&g_ahClasses[i], true /*fAutodidact*/, RT_SRC_POS, "testLo1-%u", i), VINF_SUCCESS);
    779779            RTTEST_CHECK_RC_RETV(g_hTest, RTCritSectInitEx(&g_aCritSects[i], 0, g_ahClasses[i], RTLOCKVAL_SUB_CLASS_NONE, "RTCritSectLO-Auto"), VINF_SUCCESS);
    780780            RTTEST_CHECK_RETV(g_hTest, RTLockValidatorClassRetain(g_ahClasses[i]) == 3);
     
    964964}
    965965
     966
     967static void testLo2(void)
     968{
     969    RTTestSub(g_hTest, "locking order, critsect");
     970
     971    /* Initialize the critsection with all different classes */
     972    for (unsigned i = 0; i < 4; i++)
     973    {
     974        RTTEST_CHECK_RC_RETV(g_hTest, RTLockValidatorClassCreate(&g_ahClasses[i], true /*fAutodidact*/, RT_SRC_POS, "testLo2-%u", i), VINF_SUCCESS);
     975        RTTEST_CHECK_RC_RETV(g_hTest, RTCritSectInitEx(&g_aCritSects[i], 0, g_ahClasses[i], RTLOCKVAL_SUB_CLASS_NONE, "RTCritSectLO"), VINF_SUCCESS);
     976        RTTEST_CHECK_RETV(g_hTest, RTLockValidatorClassRetain(g_ahClasses[i]) == 3);
     977        RTTEST_CHECK_RETV(g_hTest, RTLockValidatorClassRelease(g_ahClasses[i]) == 2);
     978    }
     979
     980    /* Enter the first 4 critsects in ascending order and thereby definining
     981       this as a valid lock order.  */
     982    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[0]), VINF_SUCCESS);
     983    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[1]), VINF_SUCCESS);
     984    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[2]), VINF_SUCCESS);
     985    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[3]), VINF_SUCCESS);
     986
     987    /* Now, leave and re-enter the critsects in a way that should break the
     988       order and check that we get the appropriate response. */
     989    int rc;
     990    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[0]), VINF_SUCCESS);
     991    RTTEST_CHECK_RC(g_hTest, rc = RTCritSectEnter(&g_aCritSects[0]), VERR_SEM_LV_WRONG_ORDER);
     992    if (RT_SUCCESS(rc))
     993        RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[0]), VINF_SUCCESS);
     994
     995    /* Check that recursion isn't subject to order checks. */
     996    RTTEST_CHECK_RC(g_hTest, rc = RTCritSectEnter(&g_aCritSects[1]), VINF_SUCCESS);
     997    if (RT_SUCCESS(rc))
     998        RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[1]), VINF_SUCCESS);
     999
     1000    /* Enable strict release order for class 2 and check that violations
     1001       are caught - including recursion. */
     1002    RTTEST_CHECK_RC(g_hTest, RTLockValidatorClassEnforceStrictReleaseOrder(g_ahClasses[2], true), VINF_SUCCESS);
     1003    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[2]), VINF_SUCCESS);                      /* start recursion */
     1004    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[3]), VINF_SUCCESS);
     1005    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[2]), VERR_SEM_LV_WRONG_RELEASE_ORDER);
     1006    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[3]), VINF_SUCCESS);
     1007    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[2]), VINF_SUCCESS);                      /* end recursion */
     1008    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[2]), VERR_SEM_LV_WRONG_RELEASE_ORDER);
     1009    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[1]), VINF_SUCCESS);
     1010    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[3]), VINF_SUCCESS);
     1011    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[2]), VINF_SUCCESS);
     1012
     1013    /* clean up */
     1014    for (unsigned i = 0; i < 4; i++)
     1015    {
     1016        RTTEST_CHECK(g_hTest, RTLockValidatorClassRelease(g_ahClasses[i]) == 1);
     1017        g_ahClasses[i] = NIL_RTLOCKVALCLASS;
     1018        RTTEST_CHECK_RC_RETV(g_hTest, RTCritSectDelete(&g_aCritSects[i]), VINF_SUCCESS);
     1019    }
     1020}
     1021
     1022
     1023static void testLo3(void)
     1024{
     1025    RTTestSub(g_hTest, "locking order, read-write");
     1026
     1027    /* Initialize the critsection with all different classes */
     1028    for (unsigned i = 0; i < 4; i++)
     1029    {
     1030        RTTEST_CHECK_RC_RETV(g_hTest, RTLockValidatorClassCreate(&g_ahClasses[i], true /*fAutodidact*/, RT_SRC_POS, "testLo3-%u", i), VINF_SUCCESS);
     1031        RTTEST_CHECK_RC_RETV(g_hTest, RTCritSectInitEx(&g_aCritSects[i], 0, g_ahClasses[i], RTLOCKVAL_SUB_CLASS_NONE, "RTCritSectLO"), VINF_SUCCESS);
     1032        RTTEST_CHECK_RETV(g_hTest, RTLockValidatorClassRetain(g_ahClasses[i]) == 4);
     1033        RTTEST_CHECK_RETV(g_hTest, RTLockValidatorClassRelease(g_ahClasses[i]) == 3);
     1034    }
     1035
     1036    /* Enter the first 4 critsects in ascending order and thereby definining
     1037       this as a valid lock order.  */
     1038    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[0]), VINF_SUCCESS);
     1039    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[1]), VINF_SUCCESS);
     1040    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[2]), VINF_SUCCESS);
     1041    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[3]), VINF_SUCCESS);
     1042
     1043    /* Now, leave and re-enter the critsects in a way that should break the
     1044       order and check that we get the appropriate response. */
     1045    int rc;
     1046    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[0]), VINF_SUCCESS);
     1047    RTTEST_CHECK_RC(g_hTest, rc = RTCritSectEnter(&g_aCritSects[0]), VERR_SEM_LV_WRONG_ORDER);
     1048    if (RT_SUCCESS(rc))
     1049        RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[0]), VINF_SUCCESS);
     1050
     1051    /* Check that recursion isn't subject to order checks. */
     1052    RTTEST_CHECK_RC(g_hTest, rc = RTCritSectEnter(&g_aCritSects[1]), VINF_SUCCESS);
     1053    if (RT_SUCCESS(rc))
     1054        RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[1]), VINF_SUCCESS);
     1055
     1056    /* Enable strict release order for class 2 and check that violations
     1057       are caught - including recursion. */
     1058    RTTEST_CHECK_RC(g_hTest, RTLockValidatorClassEnforceStrictReleaseOrder(g_ahClasses[2], true), VINF_SUCCESS);
     1059    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[2]), VINF_SUCCESS);                      /* start recursion */
     1060    RTTEST_CHECK_RC(g_hTest, RTCritSectEnter(&g_aCritSects[3]), VINF_SUCCESS);
     1061    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[2]), VERR_SEM_LV_WRONG_RELEASE_ORDER);
     1062    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[3]), VINF_SUCCESS);
     1063    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[2]), VINF_SUCCESS);                      /* end recursion */
     1064    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[2]), VERR_SEM_LV_WRONG_RELEASE_ORDER);
     1065    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[1]), VINF_SUCCESS);
     1066    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[3]), VINF_SUCCESS);
     1067    RTTEST_CHECK_RC(g_hTest, RTCritSectLeave(&g_aCritSects[2]), VINF_SUCCESS);
     1068
     1069    /* clean up */
     1070    for (unsigned i = 0; i < 4; i++)
     1071    {
     1072        RTTEST_CHECK(g_hTest, RTLockValidatorClassRelease(g_ahClasses[i]) == 1);
     1073        g_ahClasses[i] = NIL_RTLOCKVALCLASS;
     1074        RTTEST_CHECK_RC_RETV(g_hTest, RTCritSectDelete(&g_aCritSects[i]), VINF_SUCCESS);
     1075    }
     1076}
     1077
     1078
    9661079static bool testIsLockValidationCompiledIn(void)
    9671080{
     
    10551168    {
    10561169        testLo1();
     1170        testLo2();
    10571171    }
    10581172
  • trunk/src/VBox/VMM/PDMCritSect.cpp

    r25685 r25704  
    127127    if (RT_SUCCESS(rc))
    128128    {
    129         rc = RTLockValidatorRecExclCreate(&pCritSect->Core.pValidatorRec, NIL_RTLOCKVALCLASS, 0, pszName, pCritSect, true);
     129        rc = RTLockValidatorRecExclCreate(&pCritSect->Core.pValidatorRec, NIL_RTLOCKVALCLASS, 0, pCritSect, true, "%s", pszName);
    130130        if (RT_SUCCESS(rc))
    131131        {
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