Turns out B_RELEASE_ALL just works as expected - it was a deadlock by design; when the
cursor thread didn't call acquire_sem() fast enough, it would never get released by B_RELEASE_ALL (as that only releases all waiting threads), and thus, waited forever for the semaphore to be released again. On the other side, the input_server didn't call release_sem() anymore, since the cursor thread still didn't read out the data after the last release... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15014 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1599,11 +1599,8 @@ InputServer::_DispatchEvent(BMessage* event)
|
|||||||
#else
|
#else
|
||||||
atomic_set((int32*)&fCursorBuffer->pos, (uint32)fMousePos.x << 16UL
|
atomic_set((int32*)&fCursorBuffer->pos, (uint32)fMousePos.x << 16UL
|
||||||
| ((uint32)fMousePos.y & 0xffff));
|
| ((uint32)fMousePos.y & 0xffff));
|
||||||
if (atomic_or(&fCursorBuffer->read, 1) == 0) {
|
if (atomic_or(&fCursorBuffer->read, 1) == 0)
|
||||||
release_sem(fCursorSem);
|
release_sem(fCursorSem);
|
||||||
// TODO: this doesn't work for some reason...
|
|
||||||
// release_sem_etc(fCursorSem, 0, B_RELEASE_ALL);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user