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:
Marcus Overhagen 2006-01-16 17:56:42 +00:00
parent c7a1eae1aa
commit 5d273583ea
2 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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) {