From c1f316db61eef7c1d34f065c984e939641bee420 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Thu, 7 Jan 2010 02:21:31 +0000 Subject: [PATCH] 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 --- src/add-ons/kernel/drivers/input/wacom/wacom.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/add-ons/kernel/drivers/input/wacom/wacom.c b/src/add-ons/kernel/drivers/input/wacom/wacom.c index 6a80aaa712..8ba343c9c9 100644 --- a/src/add-ons/kernel/drivers/input/wacom/wacom.c +++ b/src/add-ons/kernel/drivers/input/wacom/wacom.c @@ -548,6 +548,9 @@ device_read(void* cookie, off_t pos, void* buf, size_t* count) // handle time out if (ret < B_OK) { usb->cancel_queued_transfers(device->pipe); + acquire_sem(device->notify_lock); + // collect the sem released by the cancel + if (ret == B_TIMED_OUT) { // a time_out is ok, since it only means that the device // had nothing to report (ie mouse/pen was not moved)