PDMAllCritSectRw.cpp revision 8c7f1eb426ed2259c4ed882d80af2666b2490867
/* $Id$ */
/** @file
*/
/*
* Copyright (C) 2009-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "PDMInternal.h"
#include <iprt/asm-amd64-x86.h>
#ifdef IN_RING3
# include <iprt/lockvalidator.h>
# include <iprt/semaphore.h>
#endif
#endif
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/** The number loops to spin for shared access in ring-3. */
#define PDMCRITSECTRW_SHRD_SPIN_COUNT_R3 20
/** The number loops to spin for shared access in ring-0. */
#define PDMCRITSECTRW_SHRD_SPIN_COUNT_R0 128
/** The number loops to spin for shared access in the raw-mode context. */
#define PDMCRITSECTRW_SHRD_SPIN_COUNT_RC 128
/** The number loops to spin for exclusive access in ring-3. */
#define PDMCRITSECTRW_EXCL_SPIN_COUNT_R3 20
/** The number loops to spin for exclusive access in ring-0. */
#define PDMCRITSECTRW_EXCL_SPIN_COUNT_R0 256
/** The number loops to spin for exclusive access in the raw-mode context. */
#define PDMCRITSECTRW_EXCL_SPIN_COUNT_RC 256
/* Undefine the automatic VBOX_STRICT API mappings. */
/**
* Gets the ring-3 native thread handle of the calling thread.
*
* @returns native thread handle (ring-3).
* R0 and RC.
*/
{
#ifdef IN_RING3
#else
#endif
return hNativeSelf;
}
#ifdef IN_RING3
/**
*
* It is recommended to try make sure that nobody is using this critical section
* while changing the value.
*
* @returns The old sub-class. RTLOCKVAL_SUB_CLASS_INVALID is returns if the
* lock validator isn't compiled in or either of the parameters are
* invalid.
* @param uSubClass The new sub-class value.
*/
{
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
# else
return RTLOCKVAL_SUB_CLASS_INVALID;
# endif
}
#endif /* IN_RING3 */
static int pdmCritSectRwEnterShared(PPDMCRITSECTRW pThis, int rcBusy, PCRTLOCKVALSRCPOS pSrcPos, bool fTryOnly)
{
/*
* Validate input.
*/
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
if (!fTryOnly)
{
int rc9;
rc9 = RTLockValidatorRecExclCheckOrder(pThis->s.Core.pValidatorWrite, hThreadSelf, pSrcPos, RT_INDEFINITE_WAIT);
else
rc9 = RTLockValidatorRecSharedCheckOrder(pThis->s.Core.pValidatorRead, hThreadSelf, pSrcPos, RT_INDEFINITE_WAIT);
if (RT_FAILURE(rc9))
return rc9;
}
#endif
/*
* Get cracking...
*/
for (;;)
{
{
/* It flows in the right direction, try follow it before it changes. */
c++;
u64State |= c << RTCSRW_CNT_RD_SHIFT;
{
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
#endif
break;
}
}
{
/* Wrong direction, but we're alone here and can simply try switch the direction. */
{
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
#endif
break;
}
}
else
{
/* Is the writer perhaps doing a read recursion? */
if (hNativeSelf == hNativeWriter)
{
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
int rc9 = RTLockValidatorRecExclRecursionMixed(pThis->s.Core.pValidatorWrite, &pThis->s.Core.pValidatorRead->Core, pSrcPos);
if (RT_FAILURE(rc9))
return rc9;
#endif
return VINF_SUCCESS; /* don't break! */
}
/* If we're only trying, return already. */
if (fTryOnly)
return VERR_SEM_BUSY;
#if defined(IN_RING3)
/*
* Add ourselves to the queue and wait for the direction to change.
*/
c++;
cWait++;
{
{
int rc;
# if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
rc = RTLockValidatorRecSharedCheckBlocking(pThis->s.Core.pValidatorRead, hThreadSelf, pSrcPos, true,
RT_INDEFINITE_WAIT, RTTHREADSTATE_RW_READ, false);
if (RT_SUCCESS(rc))
# else
# endif
{
do
return VERR_SEM_DESTROYED;
}
if (RT_FAILURE(rc))
{
/* Decrement the counts and return the error. */
for (;;)
{
c--;
cWait--;
break;
}
return rc;
}
break;
}
/* Decrement the wait count and maybe reset the semaphore (if we're last). */
for (;;)
{
cWait--;
{
if (cWait == 0)
{
{
}
}
break;
}
}
# if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
# endif
break;
}
#else
/*
* We cannot call SUPSemEventMultiWaitNoResume in this context. Go
* back to ring-3 and do it there or return rcBusy.
*/
if (rcBusy == VINF_SUCCESS)
{
/** @todo Should actually do this in via VMMR0.cpp instead of going all the way
* back to ring-3. Goes for both kind of crit sects. */
return VMMRZCallRing3(pVM, pVCpu, VMMCALLRING3_PDM_CRIT_SECT_RW_ENTER_SHARED, MMHyperCCToR3(pVM, pThis));
}
return rcBusy;
#endif
}
return VERR_SEM_DESTROYED;
ASMNopPause();
}
/* got it! */
Assert((ASMAtomicReadU64(&pThis->s.Core.u64State) & RTCSRW_DIR_MASK) == (RTCSRW_DIR_READ << RTCSRW_DIR_SHIFT));
return VINF_SUCCESS;
}
/**
* Enter a critical section with shared (read) access.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success.
* @retval @a rcBusy if in ring-0 or raw-mode context and it is busy.
* @retval VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.)
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param rcBusy The status code to return when we're in RC or R0 and the
* section is busy. Pass VINF_SUCCESS to acquired the
* critical section thru a ring-3 call if necessary.
* @param uId Where we're entering the section.
* @param pszFile The source position - file.
* @param iLine The source position - line.
* @param pszFunction The source position - function.
* @sa PDMCritSectRwEnterSharedDebug, PDMCritSectRwTryEnterShared,
* PDMCritSectRwTryEnterSharedDebug, PDMCritSectRwLeaveShared,
* RTCritSectRwEnterShared.
*/
{
#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
#else
#endif
}
/**
* Enter a critical section with shared (read) access.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success.
* @retval @a rcBusy if in ring-0 or raw-mode context and it is busy.
* @retval VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.)
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param rcBusy The status code to return when we're in RC or R0 and the
* section is busy. Pass VINF_SUCCESS to acquired the
* critical section thru a ring-3 call if necessary.
* @param uId Where we're entering the section.
* @param pszFile The source position - file.
* @param iLine The source position - line.
* @param pszFunction The source position - function.
* @sa PDMCritSectRwEnterShared, PDMCritSectRwTryEnterShared,
* PDMCritSectRwTryEnterSharedDebug, PDMCritSectRwLeaveShared,
* RTCritSectRwEnterSharedDebug.
*/
VMMDECL(int) PDMCritSectRwEnterSharedDebug(PPDMCRITSECTRW pThis, int rcBusy, RTHCUINTPTR uId, RT_SRC_POS_DECL)
{
#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
#else
#endif
}
/**
* Try enter a critical section with shared (read) access.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success.
* @retval VERR_SEM_BUSY if the critsect was owned.
* @retval VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.)
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param uId Where we're entering the section.
* @param pszFile The source position - file.
* @param iLine The source position - line.
* @param pszFunction The source position - function.
* @sa PDMCritSectRwTryEnterSharedDebug, PDMCritSectRwEnterShared,
* PDMCritSectRwEnterSharedDebug, PDMCritSectRwLeaveShared,
* RTCritSectRwTryEnterShared.
*/
{
#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
#else
#endif
}
/**
* Try enter a critical section with shared (read) access.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success.
* @retval VERR_SEM_BUSY if the critsect was owned.
* @retval VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.)
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param uId Where we're entering the section.
* @param pszFile The source position - file.
* @param iLine The source position - line.
* @param pszFunction The source position - function.
* @sa PDMCritSectRwTryEnterShared, PDMCritSectRwEnterShared,
* PDMCritSectRwEnterSharedDebug, PDMCritSectRwLeaveShared,
* RTCritSectRwTryEnterSharedDebug.
*/
VMMDECL(int) PDMCritSectRwTryEnterSharedDebug(PPDMCRITSECTRW pThis, RTHCUINTPTR uId, RT_SRC_POS_DECL)
{
#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
#else
#endif
}
#ifdef IN_RING3
/**
*
* @returns VINF_SUCCESS if entered successfully.
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param fCallRing3 Whether this is a VMMRZCallRing3()request.
*/
{
if ( rc == VINF_SUCCESS
&& fCallRing3
{
else
RTLockValidatorRecExclUnwindMixed(pThis->s.Core.pValidatorWrite, &pThis->s.Core.pValidatorRead->Core);
}
return rc;
}
#endif /* IN_RING3 */
/**
* Leave a critical section held with shared access.
*
* @returns VBox status code.
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
* @sa PDMCritSectRwEnterShared, PDMCritSectRwTryEnterShared,
* PDMCritSectRwEnterSharedDebug, PDMCritSectRwTryEnterSharedDebug,
* PDMCritSectRwLeaveExcl, RTCritSectRwLeaveShared.
*/
{
/*
* Validate handle.
*/
/*
* Check the direction and take action accordingly.
*/
{
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
if (RT_FAILURE(rc9))
return rc9;
#endif
for (;;)
{
AssertReturn(c > 0, VERR_NOT_OWNER);
c--;
if ( c > 0
|| (u64State & RTCSRW_CNT_RD_MASK) == 0)
{
/* Don't change the direction. */
u64State |= c << RTCSRW_CNT_RD_SHIFT;
break;
}
else
{
#if defined(IN_RING3)
/* Reverse the direction and signal the writer threads. */
{
break;
}
#else
/* Queue the exit request (ring-3). */
#endif
}
ASMNopPause();
}
}
else
{
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
int rc = RTLockValidatorRecExclUnwindMixed(pThis->s.Core.pValidatorWrite, &pThis->s.Core.pValidatorRead->Core);
if (RT_FAILURE(rc))
return rc;
#endif
}
return VINF_SUCCESS;
}
static int pdmCritSectRwEnterExcl(PPDMCRITSECTRW pThis, int rcBusy, PCRTLOCKVALSRCPOS pSrcPos, bool fTryOnly)
{
/*
* Validate input.
*/
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
if (!fTryOnly)
{
int rc9 = RTLockValidatorRecExclCheckOrder(pThis->s.Core.pValidatorWrite, hThreadSelf, pSrcPos, RT_INDEFINITE_WAIT);
if (RT_FAILURE(rc9))
return rc9;
}
#endif
/*
* Check if we're already the owner and just recursing.
*/
if (hNativeSelf == hNativeWriter)
{
Assert((ASMAtomicReadU64(&pThis->s.Core.u64State) & RTCSRW_DIR_MASK) == (RTCSRW_DIR_WRITE << RTCSRW_DIR_SHIFT));
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
if (RT_FAILURE(rc9))
return rc9;
#endif
return VINF_SUCCESS;
}
/*
* Get cracking.
*/
for (;;)
{
{
/* It flows in the right direction, try follow it before it changes. */
c++;
u64State |= c << RTCSRW_CNT_WR_SHIFT;
break;
}
{
/* Wrong direction, but we're alone here and can simply try switch the direction. */
break;
}
else if (fTryOnly)
/* Wrong direction and we're not supposed to wait, just return. */
return VERR_SEM_BUSY;
else
{
/* Add ourselves to the write count and break out to do the wait. */
c++;
u64State |= c << RTCSRW_CNT_WR_SHIFT;
break;
}
return VERR_SEM_DESTROYED;
ASMNopPause();
}
/*
* If we're in write mode now try grab the ownership. Play fair if there
* are threads already waiting.
*/
#if defined(IN_RING3)
|| fTryOnly)
#endif
;
if (fDone)
if (!fDone)
{
#if defined(IN_RING3)
/*
* Wait for our turn.
*/
{
int rc;
# if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
if (!fTryOnly)
{
if (hThreadSelf == NIL_RTTHREAD)
RT_INDEFINITE_WAIT, RTTHREADSTATE_RW_WRITE, false);
}
else
rc = VINF_SUCCESS;
if (RT_SUCCESS(rc))
# else
# endif
{
do
return VERR_SEM_DESTROYED;
}
if (RT_FAILURE(rc))
{
/* Decrement the counts and return the error. */
for (;;)
{
c--;
u64State |= c << RTCSRW_CNT_WR_SHIFT;
break;
}
return rc;
}
{
if (fDone)
break;
}
}
#else
/* We cannot call SUPSemEventWaitNoResume in this context. Go back to
ring-3 and do it there or return rcBusy. */
for (;;)
{
c--;
u64State |= c << RTCSRW_CNT_WR_SHIFT;
break;
}
if (rcBusy == VINF_SUCCESS)
{
/** @todo Should actually do this in via VMMR0.cpp instead of going all the way
* back to ring-3. Goes for both kind of crit sects. */
return VMMRZCallRing3(pVM, pVCpu, VMMCALLRING3_PDM_CRIT_SECT_RW_ENTER_EXCL, MMHyperCCToR3(pVM, pThis));
}
return rcBusy;
#endif
}
/*
* Got it!
*/
Assert((ASMAtomicReadU64(&pThis->s.Core.u64State) & RTCSRW_DIR_MASK) == (RTCSRW_DIR_WRITE << RTCSRW_DIR_SHIFT));
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
#endif
return VINF_SUCCESS;
}
/**
* Try enter a critical section with exclusive (write) access.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success.
* @retval @a rcBusy if in ring-0 or raw-mode context and it is busy.
* @retval VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.)
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param rcBusy The status code to return when we're in RC or R0 and the
* section is busy. Pass VINF_SUCCESS to acquired the
* critical section thru a ring-3 call if necessary.
* @sa PDMCritSectRwEnterExclDebug, PDMCritSectRwTryEnterExcl,
* PDMCritSectRwTryEnterExclDebug,
* PDMCritSectEnterDebug, PDMCritSectEnter,
* RTCritSectRwEnterExcl.
*/
{
#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
#else
#endif
}
/**
* Try enter a critical section with exclusive (write) access.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success.
* @retval @a rcBusy if in ring-0 or raw-mode context and it is busy.
* @retval VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.)
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param rcBusy The status code to return when we're in RC or R0 and the
* section is busy. Pass VINF_SUCCESS to acquired the
* critical section thru a ring-3 call if necessary.
* @param uId Where we're entering the section.
* @param pszFile The source position - file.
* @param iLine The source position - line.
* @param pszFunction The source position - function.
* @sa PDMCritSectRwEnterExcl, PDMCritSectRwTryEnterExcl,
* PDMCritSectRwTryEnterExclDebug,
* PDMCritSectEnterDebug, PDMCritSectEnter,
* RTCritSectRwEnterExclDebug.
*/
VMMDECL(int) PDMCritSectRwEnterExclDebug(PPDMCRITSECTRW pThis, int rcBusy, RTHCUINTPTR uId, RT_SRC_POS_DECL)
{
#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
#else
#endif
}
/**
* Try enter a critical section with exclusive (write) access.
*
* @retval VINF_SUCCESS on success.
* @retval VERR_SEM_BUSY if the critsect was owned.
* @retval VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.)
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @sa PDMCritSectRwEnterExcl, PDMCritSectRwTryEnterExclDebug,
* PDMCritSectRwEnterExclDebug,
* PDMCritSectTryEnter, PDMCritSectTryEnterDebug,
* RTCritSectRwTryEnterExcl.
*/
{
#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
#else
#endif
}
/**
* Try enter a critical section with exclusive (write) access.
*
* @retval VINF_SUCCESS on success.
* @retval VERR_SEM_BUSY if the critsect was owned.
* @retval VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.)
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param uId Where we're entering the section.
* @param pszFile The source position - file.
* @param iLine The source position - line.
* @param pszFunction The source position - function.
* @sa PDMCritSectRwTryEnterExcl, PDMCritSectRwEnterExcl,
* PDMCritSectRwEnterExclDebug,
* PDMCritSectTryEnterDebug, PDMCritSectTryEnter,
* RTCritSectRwTryEnterExclDebug.
*/
{
#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
#else
#endif
}
#ifdef IN_RING3
/**
*
* @returns VINF_SUCCESS if entered successfully.
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
*
* @param fCallRing3 Whether this is a VMMRZCallRing3()request.
*/
{
if ( rc == VINF_SUCCESS
&& fCallRing3
return rc;
}
#endif /* IN_RING3 */
/**
* Leave a critical section held exclusively.
*
* @returns VBox status code.
* @retval VERR_SEM_DESTROYED if the critical section is delete before or
* during the operation.
* @sa PDMCritSectRwLeaveShared, RTCritSectRwLeaveExcl.
*/
{
/*
* Validate handle.
*/
/*
* Unwind one recursion. Is it the final one?
*/
{
AssertReturn(pThis->s.Core.cWriterReads == 0, VERR_WRONG_ORDER); /* (must release all read recursions before the final write.) */
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
if (RT_FAILURE(rc9))
return rc9;
#endif
/*
* Update the state.
*/
#if defined(IN_RING3)
for (;;)
{
Assert(c > 0);
c--;
if ( c > 0
|| (u64State & RTCSRW_CNT_RD_MASK) == 0)
{
/* Don't change the direction, wake up the next writer if any. */
u64State |= c << RTCSRW_CNT_WR_SHIFT;
{
if (c > 0)
{
}
break;
}
}
else
{
/* Reverse the direction and signal the reader threads. */
{
int rc = SUPSemEventMultiSignal(pThis->s.CTX_SUFF(pVM)->pSession, (SUPSEMEVENTMULTI)pThis->s.Core.hEvtRead);
break;
}
}
ASMNopPause();
return VERR_SEM_DESTROYED;
}
#else
/*
* We cannot call neither SUPSemEventSignal nor SUPSemEventMultiSignal,
* so queue the exit request (ring-3).
*/
#endif
}
else
{
/*
* Not the final recursion.
*/
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
if (RT_FAILURE(rc9))
return rc9;
#endif
}
return VINF_SUCCESS;
}
/**
* Checks the caller is the exclusive (write) owner of the critical section.
*
* @retval @c true if owner.
* @retval @c false if not owner.
* @sa PDMCritSectRwIsReadOwner, PDMCritSectIsOwner,
* RTCritSectRwIsWriteOwner.
*/
{
/*
* Validate handle.
*/
/*
* Check ownership.
*/
if (hNativeWriter == NIL_RTNATIVETHREAD)
return false;
}
/**
* Checks if the caller is one of the read owners of the critical section.
*
* @note !CAUTION! This API doesn't work reliably if lock validation isn't
* enabled. Meaning, the answer is not trustworhty unless
* RT_LOCK_STRICT or PDMCRITSECTRW_STRICT was defined at build time.
* Also, make sure you do not use RTCRITSECTRW_FLAGS_NO_LOCK_VAL when
* creating the semaphore. And finally, if you used a locking class,
* don't disable deadlock detection by setting cMsMinDeadlock to
* RT_INDEFINITE_WAIT.
*
* In short, only use this for assertions.
*
* @returns @c true if reader, @c false if not.
* @param fWannaHear What you'd like to hear when lock validation is not
* available. (For avoiding asserting all over the place.)
* @sa PDMCritSectRwIsWriteOwner, RTCritSectRwIsReadOwner.
*/
{
/*
* Validate handle.
*/
/*
* Inspect the state.
*/
{
/*
* It's in write mode, so we can only be a reader if we're also the
* current writer.
*/
if (hWriter == NIL_RTNATIVETHREAD)
return false;
}
/*
* Read mode. If there are no current readers, then we cannot be a reader.
*/
if (!(u64State & RTCSRW_CNT_RD_MASK))
return false;
#if defined(PDMCRITSECTRW_STRICT) && defined(IN_RING3)
/*
* Ask the lock validator.
* Note! It doesn't know everything, let's deal with that if it becomes an issue...
*/
#else
/*
* Ok, we don't know, just tell the caller what he want to hear.
*/
return fWannaHear;
#endif
}
/**
* Gets the write recursion count.
*
* @returns The write recursion count (0 if bad critsect).
* @sa PDMCritSectRwGetWriterReadRecursion, PDMCritSectRwGetReadCount,
* RTCritSectRwGetWriteRecursion.
*/
{
/*
* Validate handle.
*/
/*
* Return the requested data.
*/
}
/**
* Gets the read recursion count of the current writer.
*
* @returns The read recursion count (0 if bad critsect).
* @sa PDMCritSectRwGetWriteRecursion, PDMCritSectRwGetReadCount,
* RTCritSectRwGetWriterReadRecursion.
*/
{
/*
* Validate handle.
*/
/*
* Return the requested data.
*/
}
/**
* Gets the current number of reads.
*
* This includes all read recursions, so it might be higher than the number of
* read owners. It does not include reads done by the current writer.
*
* @returns The read count (0 if bad critsect).
* @sa PDMCritSectRwGetWriteRecursion, PDMCritSectRwGetWriterReadRecursion,
* RTCritSectRwGetReadCount.
*/
{
/*
* Validate input.
*/
/*
* Return the requested data.
*/
return 0;
}
/**
*
* @retval @c true if initialized.
* @retval @c false if not initialized.
* @sa PDMCritSectIsInitialized, RTCritSectRwIsInitialized.
*/
{
}