Locking or not locking (CD drives)?
Artem Kachitchkine
Artem.Kachitchkin at Sun.COM
Wed May 31 11:44:09 PDT 2006
> Btw, I'm not sure it's desirable for Totem to lock the door. After all
> we try to give the experience that the can press the "eject" button on
> the drive to eject the disc by emitting the EjectPressed signal and then
> eventually end up having g-v-m calling gnome-eject that does Eject() on
> HAL that eventually ends up with an eject(1) on Linux.
Well, I think if you don't lock the door, then pressing the eject button
(on the drive) will immediately eject the media and software won't have
a chance to react: by the time EjectPressed handlers are invoked, the
drive will already report media as ejected (even though mechanically it
might take a couple of seconds).
If you do lock the door, but also subscribe to EjectPressed, then
nothing will happen when the eject button (on the drive) is pressed, but
the software gets notified on the user's intention, it can react
accordingly, i.e. release the resources (unmount, etc) and send the
eject command to the drive.
The disadvantage of the latter approach is that not all drives support
EjectPressed. We need some data here, is it only the older drives that
don't have support? does the situation improve over time? If two years
from now all drives will support EjectPressed, we can start relying on it.
-Artem.
More information about the hal
mailing list