Added VMCache::SwitchFromReadLock(), atomically unlocking a read lock and

starting to lock the cache.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34936 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-01-07 15:32:28 +00:00
parent c4f9831292
commit 77690f288e
1 changed files with 8 additions and 0 deletions

View File

@ -73,6 +73,7 @@ public:
inline bool Lock();
inline bool TryLock();
inline bool SwitchLock(mutex* from);
inline bool SwitchFromReadLock(rw_lock* from);
void Unlock();
inline void AssertLocked();
@ -220,6 +221,13 @@ VMCache::SwitchLock(mutex* from)
}
bool
VMCache::SwitchFromReadLock(rw_lock* from)
{
return mutex_switch_from_read_lock(from, &fLock) == B_OK;
}
void
VMCache::AssertLocked()
{