Make Volume::Read{Lock,Unlock} const
This commit is contained in:
@@ -36,8 +36,8 @@ public:
|
|||||||
Volume(fs_volume* fsVolume);
|
Volume(fs_volume* fsVolume);
|
||||||
~Volume();
|
~Volume();
|
||||||
|
|
||||||
inline bool ReadLock();
|
inline bool ReadLock() const;
|
||||||
inline void ReadUnlock();
|
inline void ReadUnlock() const;
|
||||||
inline bool WriteLock();
|
inline bool WriteLock();
|
||||||
inline void WriteUnlock();
|
inline void WriteUnlock();
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ private:
|
|||||||
const char* shineThroughSetting);
|
const char* shineThroughSetting);
|
||||||
status_t _AddPackageLinksDirectory();
|
status_t _AddPackageLinksDirectory();
|
||||||
private:
|
private:
|
||||||
rw_lock fLock;
|
mutable rw_lock fLock;
|
||||||
fs_volume* fFSVolume;
|
fs_volume* fFSVolume;
|
||||||
Directory* fRootDirectory;
|
Directory* fRootDirectory;
|
||||||
::PackageFSRoot* fPackageFSRoot;
|
::PackageFSRoot* fPackageFSRoot;
|
||||||
@@ -170,14 +170,14 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Volume::ReadLock()
|
Volume::ReadLock() const
|
||||||
{
|
{
|
||||||
return rw_lock_read_lock(&fLock) == B_OK;
|
return rw_lock_read_lock(&fLock) == B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Volume::ReadUnlock()
|
Volume::ReadUnlock() const
|
||||||
{
|
{
|
||||||
rw_lock_read_unlock(&fLock);
|
rw_lock_read_unlock(&fLock);
|
||||||
}
|
}
|
||||||
@@ -197,7 +197,8 @@ Volume::WriteUnlock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef AutoLocker<Volume, AutoLockerReadLocking<Volume> > VolumeReadLocker;
|
typedef AutoLocker<const Volume, AutoLockerReadLocking<const Volume> >
|
||||||
|
VolumeReadLocker;
|
||||||
typedef AutoLocker<Volume, AutoLockerWriteLocking<Volume> > VolumeWriteLocker;
|
typedef AutoLocker<Volume, AutoLockerWriteLocking<Volume> > VolumeWriteLocker;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user