From f91bf83feb0c541935e92dd1d82889d27aaffe67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 29 Jan 2007 22:40:29 +0000 Subject: [PATCH] We must not wait for the reply of the registrar - this fixes a deadlock between the registrar and the app_server. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20013 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/app/Roster.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/kits/app/Roster.cpp b/src/kits/app/Roster.cpp index f6b5ae1719..93b931a4e7 100644 --- a/src/kits/app/Roster.cpp +++ b/src/kits/app/Roster.cpp @@ -1738,6 +1738,8 @@ BRoster::_ApplicationCrashed(team_id team) Tells the registrar which application is currently active. It's called from within the app_server when the active application is changed. + As it's called in the event loop, it must run asynchronously and cannot + wait for a reply. */ status_t BRoster::_UpdateActiveApp(team_id team) const @@ -1748,18 +1750,11 @@ BRoster::_UpdateActiveApp(team_id team) const // compose the request message BMessage request(B_REG_UPDATE_ACTIVE_APP); status_t status = request.AddInt32("team", team); + if (status < B_OK) + return status; // send the request - BMessage reply; - if (status == B_OK) - status = fMessenger.SendMessage(&request, &reply); - - // evaluate the reply - if (status == B_OK && reply.what != B_REG_SUCCESS - && reply.FindInt32("error", &status) != B_OK) - status = B_ERROR; - - return status; + return fMessenger.SendMessage(&request); }