bugfix, noticed that releasing a semaphore 0 times isn't very useful
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15979 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c7a1eae1aa
commit
5d273583ea
@ -98,7 +98,7 @@ ps2_dev_handle_int(ps2_dev *dev, uint8 data)
|
||||
dev->result_buf_idx++;
|
||||
dev->result_buf_cnt--;
|
||||
if (dev->result_buf_cnt == 0) {
|
||||
release_sem_etc(dev->result_sem, 0, B_DO_NOT_RESCHEDULE);
|
||||
release_sem_etc(dev->result_sem, 1, B_DO_NOT_RESCHEDULE);
|
||||
return B_INVOKE_SCHEDULER;
|
||||
}
|
||||
return B_HANDLED_INTERRUPT;
|
||||
|
@ -41,7 +41,9 @@ ps2_service_handle_device_added(ps2_dev *dev)
|
||||
cmd.dev = dev;
|
||||
|
||||
packet_buffer_write(sServiceCmdBuffer, (const uint8 *)&cmd, sizeof(cmd));
|
||||
release_sem_etc(sServiceSem, 0, B_DO_NOT_RESCHEDULE);
|
||||
release_sem_etc(sServiceSem, 1, B_DO_NOT_RESCHEDULE);
|
||||
|
||||
TRACE(("ps2_service_handle_device_added done\n"));
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +58,7 @@ ps2_service_handle_device_removed(ps2_dev *dev)
|
||||
cmd.dev = dev;
|
||||
|
||||
packet_buffer_write(sServiceCmdBuffer, (const uint8 *)&cmd, sizeof(cmd));
|
||||
release_sem_etc(sServiceSem, 0, B_DO_NOT_RESCHEDULE);
|
||||
release_sem_etc(sServiceSem, 1, B_DO_NOT_RESCHEDULE);
|
||||
}
|
||||
|
||||
|
||||
@ -103,6 +105,8 @@ ps2_service_thread(void *arg)
|
||||
// process service commands
|
||||
|
||||
ps2_service_cmd cmd;
|
||||
|
||||
TRACE(("ps2_service_thread: reading cmd\n"));
|
||||
|
||||
packet_buffer_read(sServiceCmdBuffer, (uint8 *)&cmd, sizeof(cmd));
|
||||
switch (cmd.id) {
|
||||
|
Loading…
Reference in New Issue
Block a user