* Fixed a possible dead lock between the kernel daemon and the DDM; the media
status checker now only tries to lock the manager, it won't wait anymore. * Added MediaChanged() and UpdateMediaStatusIfNeeded() methods to KDiskDevice. * KDiskDeviceManager::_CheckMediaStatus() now uses these new methods; it should no longer detect removed media more than once :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22621 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -239,9 +239,26 @@ KDiskDevice::IsRemovable() const
|
||||
bool
|
||||
KDiskDevice::HasMedia() const
|
||||
{
|
||||
return (fMediaStatus == B_OK);
|
||||
return fMediaStatus == B_OK || fMediaStatus == B_DEV_MEDIA_CHANGED;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
KDiskDevice::MediaChanged() const
|
||||
{
|
||||
return fMediaStatus == B_DEV_MEDIA_CHANGED;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
KDiskDevice::UpdateMediaStatusIfNeeded()
|
||||
{
|
||||
// TODO: allow a device to notify us about its media status!
|
||||
// This will then also need to clear any B_DEV_MEDIA_CHANGED
|
||||
GetMediaStatus(&fMediaStatus);
|
||||
}
|
||||
|
||||
|
||||
// SetPath
|
||||
status_t
|
||||
KDiskDevice::SetPath(const char *path)
|
||||
|
||||
Reference in New Issue
Block a user