Add separate Read/WriteUnlock methods in MutexRW.

Some platforms, particularly Windows, do not have a single method that can
release both a held reader lock and a held writer lock; instead, a
separate method (ReleaseSRWLockShared or ReleaseSRWLockExclusive) must be
called in each case.

This may also be necessary to back MutexRW with a shared_mutex in C++14;
the current language proposal includes both an unlock() and a
shared_unlock() method.
This commit is contained in:
Bradley Grainger
2014-06-16 15:41:46 -07:00
parent 983c93d731
commit 2d02ec6533
5 changed files with 9 additions and 6 deletions

View File

@@ -252,7 +252,7 @@ void VectorRep::Get(const LookupKey& k, void* callback_args,
bucket.reset(new Bucket(*bucket_)); // make a copy
}
VectorRep::Iterator iter(vector_rep, immutable_ ? bucket_ : bucket, compare_);
rwlock_.Unlock();
rwlock_.ReadUnlock();
for (iter.Seek(k.user_key(), k.memtable_key().data());
iter.Valid() && callback_func(callback_args, iter.key()); iter.Next()) {