summaryrefslogtreecommitdiff
path: root/src/unstable
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2013-02-22 00:15:43 +0000
committerMike Buland <eichlan@xagasoft.com>2013-02-22 00:15:43 +0000
commitfc7fc244600f504b6f832d8106a9218ef6a9b88b (patch)
tree45a6d19d6d883e3010fd54c868e8718f46440c58 /src/unstable
parentf4f7e50602798a2084d5cf7efc70226ac328ebc1 (diff)
downloadlibbu++-fc7fc244600f504b6f832d8106a9218ef6a9b88b.tar.gz
libbu++-fc7fc244600f504b6f832d8106a9218ef6a9b88b.tar.bz2
libbu++-fc7fc244600f504b6f832d8106a9218ef6a9b88b.tar.xz
libbu++-fc7fc244600f504b6f832d8106a9218ef6a9b88b.zip
The test for Bu::ReadWriteMutex is better and there is more documentation now.
Diffstat (limited to 'src/unstable')
-rw-r--r--src/unstable/readwritemutex.cpp9
1 files changed, 9 insertions, 0 deletions
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()
49 mRead.unlock(); 49 mRead.unlock();
50} 50}
51 51
52//
53// The bWantWrite could be a counter like the read lock counter, however
54// once a write lock occurs and bWantWrite is set at least one wite
55// will definately occur. In practice most writes all happen one after
56// the other anyway and this way reads get a chance to mingle in.
57//
58// Really, just getting all currint reads to stop so a write can happen
59// I think is sufficient right now.
60//
52void Bu::ReadWriteMutex::lockWrite() 61void Bu::ReadWriteMutex::lockWrite()
53{ 62{
54 // Lock the read counter 63 // Lock the read counter