VirtualBox

Changeset 25620 in vbox for trunk/src/VBox/Runtime/r3/posix


Ignore:
Timestamp:
Jan 2, 2010 10:18:07 PM (15 years ago)
Author:
vboxsync
Message:

iprt/semaphore.h: Added Debug wrappers for all the RW semaphores.

File:
1 edited

Legend:

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

    r25618 r25620  
    9393
    9494
     95/* No debug wrapping here. */
     96#undef RTSemRWRequestRead
     97#undef RTSemRWRequestReadNoResume
     98#undef RTSemRWRequestWrite
     99#undef RTSemRWRequestWriteNoResume
     100
     101
    95102RTDECL(int) RTSemRWCreate(PRTSEMRW pRWSem)
    96103{
     
    180187
    181188
    182 RTDECL(int) RTSemRWRequestRead(RTSEMRW RWSem, unsigned cMillies)
    183 {
    184     PRTLOCKVALSRCPOS pSrcPos = NULL;
    185 
     189DECL_FORCE_INLINE(int) rtSemRWRequestRead(RTSEMRW RWSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)
     190{
    186191    /*
    187192     * Validate input.
     
    281286
    282287
     288RTDECL(int) RTSemRWRequestRead(RTSEMRW RWSem, unsigned cMillies)
     289{
     290#ifndef RTSEMRW_STRICT
     291    return rtSemRWRequestRead(RWSem, cMillies, NULL);
     292#else
     293    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
     294    return rtSemRWRequestRead(RWSem, cMillies, &SrcPos);
     295#endif
     296}
     297
     298
     299RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW RWSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     300{
     301    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
     302    return rtSemRWRequestRead(RWSem, cMillies, &SrcPos);
     303}
     304
     305
    283306RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW RWSem, unsigned cMillies)
    284307{
    285308    /* EINTR isn't returned by the wait functions we're using. */
    286     return RTSemRWRequestRead(RWSem, cMillies);
     309#ifndef RTSEMRW_STRICT
     310    return rtSemRWRequestRead(RWSem, cMillies, NULL);
     311#else
     312    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
     313    return rtSemRWRequestRead(RWSem, cMillies, &SrcPos);
     314#endif
     315}
     316
     317
     318RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW RWSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     319{
     320    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
     321    return rtSemRWRequestRead(RWSem, cMillies, &SrcPos);
    287322}
    288323
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