When canceling the transfer, the callback is still called, just with the

canceled status, so we need to collect the corresponding sem release. Otherwise
we would run directly into the old cancel status the next time we schedule.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34932 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2010-01-07 02:21:31 +00:00
parent dfddb9f479
commit c1f316db61

View File

@ -548,6 +548,9 @@ device_read(void* cookie, off_t pos, void* buf, size_t* count)
// handle time out // handle time out
if (ret < B_OK) { if (ret < B_OK) {
usb->cancel_queued_transfers(device->pipe); usb->cancel_queued_transfers(device->pipe);
acquire_sem(device->notify_lock);
// collect the sem released by the cancel
if (ret == B_TIMED_OUT) { if (ret == B_TIMED_OUT) {
// a time_out is ok, since it only means that the device // a time_out is ok, since it only means that the device
// had nothing to report (ie mouse/pen was not moved) // had nothing to report (ie mouse/pen was not moved)