* Do not continue in the loop when encountering B_INTERRUPTED from

acquire_sem_etc(), but treat it as an error instead. This allows
  to kill device polling threads in the input_server and prevents
  a busy loop in the kernel then. Before the input_server was shutting
  down devices upon quit (happens only when restarting it), this
  busy loop could also be observed, since then polling threads would
  be quit on exit of the team.
* Supply B_INFINITE_TIMEOUT for the MouseDevice instead of 0. Does not
  change anything, but was probably not intended.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28407 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-10-31 17:31:21 +00:00
parent d6013f6096
commit a6b4486702
2 changed files with 2 additions and 6 deletions
@@ -89,8 +89,6 @@ KeyboardDevice::Control(uint32 op, void *buffer, size_t length)
// the next timeout is reduced to the repeat_rate
fCurrentRepeatDelay = fRepeatRate;
break;
} else if (result == B_INTERRUPTED && IsOpen()) {
continue;
} else
return result;
}
@@ -45,10 +45,8 @@ MouseDevice::Control(uint32 op, void *buffer, size_t length)
// NOTE: this thread is now blocking until the semaphore is
// released in the callback function
status_t result = acquire_sem_etc(fTransferNotifySem, 1,
B_CAN_INTERRUPT, 0);
if (result == B_INTERRUPTED && IsOpen())
continue;
else if (result != B_OK)
B_CAN_INTERRUPT, B_INFINITE_TIMEOUT);
if (result != B_OK)
return result;
result = _InterpretBuffer();