From 1ac0daa99f74f3777b7adc9bd1630a5d7097ed99 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 23 Jun 2011 16:35:05 +0200 Subject: [PATCH] Make Volume::Read{Lock,Unlock} const --- src/add-ons/kernel/file_systems/packagefs/Volume.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/add-ons/kernel/file_systems/packagefs/Volume.h b/src/add-ons/kernel/file_systems/packagefs/Volume.h index 5b46ad2a32..813b0f505c 100644 --- a/src/add-ons/kernel/file_systems/packagefs/Volume.h +++ b/src/add-ons/kernel/file_systems/packagefs/Volume.h @@ -36,8 +36,8 @@ public: Volume(fs_volume* fsVolume); ~Volume(); - inline bool ReadLock(); - inline void ReadUnlock(); + inline bool ReadLock() const; + inline void ReadUnlock() const; inline bool WriteLock(); inline void WriteUnlock(); @@ -144,7 +144,7 @@ private: const char* shineThroughSetting); status_t _AddPackageLinksDirectory(); private: - rw_lock fLock; + mutable rw_lock fLock; fs_volume* fFSVolume; Directory* fRootDirectory; ::PackageFSRoot* fPackageFSRoot; @@ -170,14 +170,14 @@ private: bool -Volume::ReadLock() +Volume::ReadLock() const { return rw_lock_read_lock(&fLock) == B_OK; } void -Volume::ReadUnlock() +Volume::ReadUnlock() const { rw_lock_read_unlock(&fLock); } @@ -197,7 +197,8 @@ Volume::WriteUnlock() } -typedef AutoLocker > VolumeReadLocker; +typedef AutoLocker > + VolumeReadLocker; typedef AutoLocker > VolumeWriteLocker;