Index: /trunk/include/iprt/semaphore.h
===================================================================
--- /trunk/include/iprt/semaphore.h	(revision 25615)
+++ /trunk/include/iprt/semaphore.h	(revision 25616)
@@ -594,4 +594,15 @@
  */
 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW RWSem);
+
+/**
+ * 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 semaphore handle).
+ * @param   RWSem       The Read/Write semaphore in question.
+ */
+RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW RWSem);
 
 /** @} */
Index: /trunk/src/VBox/Runtime/generic/semrw-generic.cpp
===================================================================
--- /trunk/src/VBox/Runtime/generic/semrw-generic.cpp	(revision 25615)
+++ /trunk/src/VBox/Runtime/generic/semrw-generic.cpp	(revision 25616)
@@ -513,5 +513,12 @@
      */
     RTNATIVETHREAD hNativeSelf = pThis->CritSect.NativeThreadOwner;
-    if (!pThis->cReads && (!pThis->cWrites || pThis->hWriter == hNativeSelf))
+    if (    !pThis->cReads
+        &&  (   (   !pThis->cWrites
+                 && (   !pThis->cWritesWaiting /* play fair if we can wait */
+                     || !cMillies)
+                )
+             || pThis->hWriter == hNativeSelf
+            )
+       )
     {
         /*
@@ -785,2 +792,22 @@
 }
 RT_EXPORT_SYMBOL(RTSemRWGetWriterReadRecursion);
+
+
+RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW RWSem)
+{
+    /*
+     * Validate input.
+     */
+    struct RTSEMRWINTERNAL *pThis = RWSem;
+    AssertPtrReturn(pThis, 0);
+    AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC,
+                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
+                    0);
+
+    /*
+     * Return the requested data.
+     */
+    return pThis->cReads;
+}
+RT_EXPORT_SYMBOL(RTSemRWGetReadCount);
+
Index: /trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp	(revision 25615)
+++ /trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp	(revision 25616)
@@ -590,2 +590,21 @@
     return pThis->cWriterReads;
 }
+
+
+RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW RWSem)
+{
+    /*
+     * Validate input.
+     */
+    struct RTSEMRWINTERNAL *pThis = RWSem;
+    AssertPtrReturn(pThis, 0);
+    AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC,
+                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
+                    0);
+
+    /*
+     * Return the requested data.
+     */
+    return pThis->cReaders;
+}
+
