/haiku/src/add-ons/input_server/devices/mouse/ |
H A D | MouseInputDevice.h | c5555ad3c04e295fccf9600cb0aa6eb45eadfbf5 Fri Oct 24 21:46:36 UTC 2008 Stephan Aßmus <superstippi@gmx.de> * Ignore B_ENTRY_REMOVED node monitor messages. * When the device watcher/control thread encounteres an error when read()ing or ioctl()ing the device, don't just quit the thread and leave a stale device add-on hanging there, but instead trigger _RemoveDevice() to exit this cleanly. This also takes care of calling _RemoveDevice() only from one thread. However, it adds a race condition should a mouse or keyboard be unplugged and plugged at the same time. I need to think about how to fix that cleanly, although the situation may be theoretical only... This fix seems to fix another problem with hot-plugging USB mice, before this change, the first mouse entry in /dev/input/mouse/usb/ was never gone and I got two entries after unplugging and replugging. * When using BObjectList configured to own the entries - don't delete the entries! Also don't call RemoveItem() before still using the item. Took me all day to find this one, because the code looked so... correct. :-} * In _AddDevice() call _RemoveDevice() just for the sake of it. It is really important that no device with the same name is published twice. The PS/2 driver behaves strange in that it publishes device more than once, if I understand correctly, until it decides that there is no device. * Only StartMonitoringDevice() /after/ having performed the initial device scan! Or else we may get ourselves confused. I don't know if this was an actual problem, but the code was like that before and it seems saner to me. Seeing there is no locking in the device add-on itself, we may already enter the code from the node monitor thread.
This should fix #2894.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28321 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
H A D | MouseInputDevice.cpp | c5555ad3c04e295fccf9600cb0aa6eb45eadfbf5 Fri Oct 24 21:46:36 UTC 2008 Stephan Aßmus <superstippi@gmx.de> * Ignore B_ENTRY_REMOVED node monitor messages. * When the device watcher/control thread encounteres an error when read()ing or ioctl()ing the device, don't just quit the thread and leave a stale device add-on hanging there, but instead trigger _RemoveDevice() to exit this cleanly. This also takes care of calling _RemoveDevice() only from one thread. However, it adds a race condition should a mouse or keyboard be unplugged and plugged at the same time. I need to think about how to fix that cleanly, although the situation may be theoretical only... This fix seems to fix another problem with hot-plugging USB mice, before this change, the first mouse entry in /dev/input/mouse/usb/ was never gone and I got two entries after unplugging and replugging. * When using BObjectList configured to own the entries - don't delete the entries! Also don't call RemoveItem() before still using the item. Took me all day to find this one, because the code looked so... correct. :-} * In _AddDevice() call _RemoveDevice() just for the sake of it. It is really important that no device with the same name is published twice. The PS/2 driver behaves strange in that it publishes device more than once, if I understand correctly, until it decides that there is no device. * Only StartMonitoringDevice() /after/ having performed the initial device scan! Or else we may get ourselves confused. I don't know if this was an actual problem, but the code was like that before and it seems saner to me. Seeing there is no locking in the device add-on itself, we may already enter the code from the node monitor thread.
This should fix #2894.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28321 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
/haiku/src/add-ons/input_server/devices/keyboard/ |
H A D | KeyboardInputDevice.h | c5555ad3c04e295fccf9600cb0aa6eb45eadfbf5 Fri Oct 24 21:46:36 UTC 2008 Stephan Aßmus <superstippi@gmx.de> * Ignore B_ENTRY_REMOVED node monitor messages. * When the device watcher/control thread encounteres an error when read()ing or ioctl()ing the device, don't just quit the thread and leave a stale device add-on hanging there, but instead trigger _RemoveDevice() to exit this cleanly. This also takes care of calling _RemoveDevice() only from one thread. However, it adds a race condition should a mouse or keyboard be unplugged and plugged at the same time. I need to think about how to fix that cleanly, although the situation may be theoretical only... This fix seems to fix another problem with hot-plugging USB mice, before this change, the first mouse entry in /dev/input/mouse/usb/ was never gone and I got two entries after unplugging and replugging. * When using BObjectList configured to own the entries - don't delete the entries! Also don't call RemoveItem() before still using the item. Took me all day to find this one, because the code looked so... correct. :-} * In _AddDevice() call _RemoveDevice() just for the sake of it. It is really important that no device with the same name is published twice. The PS/2 driver behaves strange in that it publishes device more than once, if I understand correctly, until it decides that there is no device. * Only StartMonitoringDevice() /after/ having performed the initial device scan! Or else we may get ourselves confused. I don't know if this was an actual problem, but the code was like that before and it seems saner to me. Seeing there is no locking in the device add-on itself, we may already enter the code from the node monitor thread.
This should fix #2894.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28321 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
H A D | KeyboardInputDevice.cpp | c5555ad3c04e295fccf9600cb0aa6eb45eadfbf5 Fri Oct 24 21:46:36 UTC 2008 Stephan Aßmus <superstippi@gmx.de> * Ignore B_ENTRY_REMOVED node monitor messages. * When the device watcher/control thread encounteres an error when read()ing or ioctl()ing the device, don't just quit the thread and leave a stale device add-on hanging there, but instead trigger _RemoveDevice() to exit this cleanly. This also takes care of calling _RemoveDevice() only from one thread. However, it adds a race condition should a mouse or keyboard be unplugged and plugged at the same time. I need to think about how to fix that cleanly, although the situation may be theoretical only... This fix seems to fix another problem with hot-plugging USB mice, before this change, the first mouse entry in /dev/input/mouse/usb/ was never gone and I got two entries after unplugging and replugging. * When using BObjectList configured to own the entries - don't delete the entries! Also don't call RemoveItem() before still using the item. Took me all day to find this one, because the code looked so... correct. :-} * In _AddDevice() call _RemoveDevice() just for the sake of it. It is really important that no device with the same name is published twice. The PS/2 driver behaves strange in that it publishes device more than once, if I understand correctly, until it decides that there is no device. * Only StartMonitoringDevice() /after/ having performed the initial device scan! Or else we may get ourselves confused. I don't know if this was an actual problem, but the code was like that before and it seems saner to me. Seeing there is no locking in the device add-on itself, we may already enter the code from the node monitor thread.
This should fix #2894.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28321 a95241bf-73f2-0310-859d-f6bbb57e9c96
|