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:
Axel Dörfler 2005-11-30 15:31:33 +00:00
parent 66fdfb907b
commit 92766f93e2
2 changed files with 5 additions and 9 deletions

View File

@ -269,8 +269,9 @@ EventDispatcher::_Unset()
fStream->SendQuit();
wait_for_thread(fThread, NULL);
wait_for_thread(fCursorThread, NULL);
status_t status;
wait_for_thread(fThread, &status);
wait_for_thread(fCursorThread, &status);
fThread = fCursorThread = -1;

View File

@ -213,13 +213,8 @@ InputServerStream::_MessageFromPort(BMessage** _message, bigtime_t timeout)
}
if (code == 'quit') {
// special code to tell our client to quit
BMessage* message = new BMessage(B_QUIT_REQUESTED);
if (message == NULL)
return B_NO_MEMORY;
*_message = message;
return B_OK;
// this will cause GetNextEvent() to return false
return B_BAD_PORT_ID;
}
// we have the message, now let's unflatten it