From fc7fc244600f504b6f832d8106a9218ef6a9b88b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 22 Feb 2013 00:15:43 +0000 Subject: The test for Bu::ReadWriteMutex is better and there is more documentation now. --- src/unstable/readwritemutex.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/unstable/readwritemutex.cpp') diff --git a/src/unstable/readwritemutex.cpp b/src/unstable/readwritemutex.cpp index 3d8ac7a..62e9ee1 100644 --- a/src/unstable/readwritemutex.cpp +++ b/src/unstable/readwritemutex.cpp @@ -49,6 +49,15 @@ void Bu::ReadWriteMutex::unlockRead() mRead.unlock(); } +// +// The bWantWrite could be a counter like the read lock counter, however +// once a write lock occurs and bWantWrite is set at least one wite +// will definately occur. In practice most writes all happen one after +// the other anyway and this way reads get a chance to mingle in. +// +// Really, just getting all currint reads to stop so a write can happen +// I think is sufficient right now. +// void Bu::ReadWriteMutex::lockWrite() { // Lock the read counter -- cgit v1.2.3