Index: /trunk/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp	(revision 45309)
+++ /trunk/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp	(revision 45310)
@@ -548,5 +548,5 @@
 
             if (   c > 0
-                || (u64State & RTCSRW_CNT_RD_MASK) == 0)
+                || (u64State & RTCSRW_CNT_WR_MASK) == 0)
             {
                 /* Don't change the direction. */
@@ -573,5 +573,5 @@
                 PVMCPU      pVCpu = VMMGetCpu(pVM);                 AssertPtr(pVCpu);
                 uint32_t    i     = pVCpu->pdm.s.cQueuedCritSectRwShrdLeaves++;
-                LogFlow(("PDMCritSectRwLeaveShared: [%d]=%p => R3\n", i, pThis));
+                LogFlow(("PDMCritSectRwLeaveShared: [%d]=%p => R3 c=%d (%#llx)\n", i, pThis, c, u64State));
                 AssertFatal(i < RT_ELEMENTS(pVCpu->pdm.s.apQueuedCritSectRwShrdLeaves));
                 pVCpu->pdm.s.apQueuedCritSectRwShrdLeaves[i] = MMHyperCCToR3(pVM, pThis);
@@ -580,4 +580,5 @@
                 STAM_REL_COUNTER_INC(&pVM->pdm.s.StatQueuedCritSectLeaves);
                 STAM_REL_COUNTER_INC(&pThis->s.StatContentionRZLeaveShared);
+                break;
 #endif
             }
