VirtualBox

Changeset 25612 in vbox for trunk/src/VBox/Runtime/generic


Ignore:
Timestamp:
Dec 31, 2009 3:06:05 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56303
Message:

semrw-generic.cpp: unfinished instrumentation of the code, but gotta run now...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/semrw-generic.cpp

    r25522 r25612  
    3939#include "internal/iprt.h"
    4040
    41 #include <iprt/critsect.h>
    42 #include <iprt/alloc.h>
    43 #include <iprt/time.h>
    4441#include <iprt/asm.h>
    4542#include <iprt/assert.h>
     43#include <iprt/critsect.h>
     44#include <iprt/err.h>
     45#include <iprt/lockvalidator.h>
     46#include <iprt/mem.h>
     47#include <iprt/time.h>
    4648#include <iprt/thread.h>
    47 #include <iprt/err.h>
    48 #include <iprt/stream.h>
    4949
    5050#include "internal/magics.h"
     51#include "internal/strict.h"
    5152
    5253
     
    8182    /** Need to reset ReadEvent. */
    8283    bool                fNeedResetReadEvent;
     84#ifdef RTSEMRW_STRICT
     85    /** The validator record for the writer. */
     86    RTLOCKVALRECEXCL    ValidatorWrite;
     87    /** The validator record for the readers. */
     88    RTLOCKVALRECSHRD    ValidatorRead;
     89#endif
    8390};
    8491
     
    121128                        pThis->fNeedResetReadEvent  = true;
    122129                        pThis->u32Magic             = RTSEMRW_MAGIC;
     130#ifdef RTSEMRW_STRICT
     131                        RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemRW", pThis);
     132                        RTLockValidatorRecSharedInit(&pThis->ValidatorRead,  NIL_RTLOCKVALIDATORCLASS, RTLOCKVALIDATOR_SUB_CLASS_NONE, "RTSemRW", pThis);
     133                        RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core);
     134#endif
    123135                        *pRWSem = pThis;
    124136                        return VINF_SUCCESS;
     
    181193            AssertMsgRC(rc, ("RTCritSectDelete failed! rc=%Rrc\n", rc));
    182194
     195#ifdef RTSEMRW_STRICT
     196            RTLockValidatorRecSharedDelete(&pThis->ValidatorRead);
     197            RTLockValidatorRecExclDelete(&pThis->ValidatorWrite);
     198#endif
    183199            RTMemFree(pThis);
    184200            rc = VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

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