EventDispatcher::_Unset() did not wait for the event looper thread under BeOS, as
wait_for_thread() always returns B_BAD_ADDRESS when the second argument is NULL (it works fine under Haiku). Instead of enqueuing a B_QUIT_REQUESTED message, InputStream now directly quits when the 'quit' code is read from the port (B_QUIT_REQUESTED was never handled by the event loop either, it just didn't get noticed because of the wrong wait_for_thread() usage). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15240 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -269,8 +269,9 @@ EventDispatcher::_Unset()
|
|||||||
|
|
||||||
fStream->SendQuit();
|
fStream->SendQuit();
|
||||||
|
|
||||||
wait_for_thread(fThread, NULL);
|
status_t status;
|
||||||
wait_for_thread(fCursorThread, NULL);
|
wait_for_thread(fThread, &status);
|
||||||
|
wait_for_thread(fCursorThread, &status);
|
||||||
|
|
||||||
fThread = fCursorThread = -1;
|
fThread = fCursorThread = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -213,13 +213,8 @@ InputServerStream::_MessageFromPort(BMessage** _message, bigtime_t timeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (code == 'quit') {
|
if (code == 'quit') {
|
||||||
// special code to tell our client to quit
|
// this will cause GetNextEvent() to return false
|
||||||
BMessage* message = new BMessage(B_QUIT_REQUESTED);
|
return B_BAD_PORT_ID;
|
||||||
if (message == NULL)
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
*_message = message;
|
|
||||||
return B_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// we have the message, now let's unflatten it
|
// we have the message, now let's unflatten it
|
||||||
|
|||||||
Reference in New Issue
Block a user