VirtualBox

Ignore:
Timestamp:
Jan 8, 2010 1:20:15 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56423
Message:

iprt/lockvalidator: Record recursion on the lock stack.

Location:
trunk/src/VBox/Runtime/include/internal
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/lockvalidator.h

    r25689 r25690  
    3838RT_C_DECLS_BEGIN
    3939
     40
     41/**
     42 * Record used only on the lock stack for recording the stack and source
     43 * position of a recursive lock acquisition.
     44 */
     45typedef struct RTLOCKVALRECNEST
     46{
     47    RTLOCKVALRECCORE                Core;
     48    /** The recursion level at this point in the stack. */
     49    uint32_t                        cRecursion;
     50    /** Pointer to the next record on the stack. */
     51    PRTLOCKVALRECUNION volatile     pDown;
     52    /** Pointer to the first recursion. */
     53    PRTLOCKVALRECUNION volatile     pRec;
     54    /** Pointer to the next free record when in the
     55     *  RTLOCKVALPERTHREAD::pFreeNestRecs list. */
     56    struct RTLOCKVALRECNEST        *pNextFree;
     57    /** The source position. */
     58    RTLOCKVALSRCPOS                 SrcPos;
     59} RTLOCKVALRECNEST;
     60/** Pointer to a recursion record. */
     61typedef RTLOCKVALRECNEST *PRTLOCKVALRECNEST;
     62
     63
    4064/**
    4165 * Record union for simplifying internal processing.
     
    4367typedef union RTLOCKVALRECUNION
    4468{
    45     RTLOCKVALRECCORE      Core;
    46     RTLOCKVALRECEXCL      Excl;
    47     RTLOCKVALRECSHRD      Shared;
    48     RTLOCKVALRECSHRDOWN   ShrdOwner;
     69    RTLOCKVALRECCORE                Core;
     70    RTLOCKVALRECEXCL                Excl;
     71    RTLOCKVALRECSHRD                Shared;
     72    RTLOCKVALRECSHRDOWN             ShrdOwner;
     73    RTLOCKVALRECNEST                Nest;
    4974} RTLOCKVALRECUNION;
    5075
     
    5984    /** Where we are blocking. */
    6085    RTLOCKVALSRCPOS                 SrcPos;
     86    /** Top of the lock stack. */
     87    PRTLOCKVALRECUNION volatile     pStackTop;
     88    /** List of free recursion (nesting) record. */
     89    PRTLOCKVALRECNEST               pFreeNestRecs;
    6190    /** What we're blocking on.
    6291     * The lock validator sets this, RTThreadUnblock clears it. */
     
    6594     * RTThreadUnblocking uses this to figure out when to clear pRec. */
    6695    RTTHREADSTATE volatile          enmRecState;
    67     /** Top of the lock stack. */
    68     PRTLOCKVALRECUNION volatile     pStackTop;
    6996    /** The thread is running inside the lock validator. */
    7097    bool volatile                   fInValidator;
     
    85112
    86113DECLHIDDEN(void)    rtLockValidatorInitPerThread(RTLOCKVALPERTHREAD *pPerThread);
     114DECLHIDDEN(void)    rtLockValidatorDeletePerThread(RTLOCKVALPERTHREAD *pPerThread);
    87115DECLHIDDEN(void)    rtLockValidatorSerializeDestructEnter(void);
    88116DECLHIDDEN(void)    rtLockValidatorSerializeDestructLeave(void);
  • trunk/src/VBox/Runtime/include/internal/magics.h

    r25682 r25690  
    8383/** The magic value for RTLOCKVALRECSHRDOWN::u32Magic after deletion. */
    8484#define RTLOCKVALRECSHRDOWN_MAGIC_DEAD  UINT32_C(0x19760509)
     85/** The magic value for RTLOCKVALRECNEST::u32Magic. (Anne Desclos) */
     86#define RTLOCKVALRECNEST_MAGIC          UINT32_C(0x19071123)
     87/** The magic value for RTLOCKVALRECNEST::u32Magic after deletion. */
     88#define RTLOCKVALRECNEST_MAGIC_DEAD     UINT32_C(0x19980427)
    8589/** Magic number for RTMEMCACHEINT::u32Magic. (Joseph Weizenbaum) */
    8690#define RTMEMCACHE_MAGIC                UINT32_C(0x19230108)
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