From 4ce1e1d2e4650c4ba697fd90946c38652735ede1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 17 Sep 2008 18:01:37 +0000 Subject: [PATCH] * Fixed a possible deadlock on quit: ActivityView::DetachedFromWindow() is called with the window lock held, so it's not a good idea to wait for a thread that may also lock the window. Now, it no longer does that, but just sends a B_INVALIDATE message instead of calling Invalidate() directly. * This closes bug #2737. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27599 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/activitymonitor/ActivityView.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/apps/activitymonitor/ActivityView.cpp b/src/apps/activitymonitor/ActivityView.cpp index 36212df8ac..a457adad3d 100644 --- a/src/apps/activitymonitor/ActivityView.cpp +++ b/src/apps/activitymonitor/ActivityView.cpp @@ -1271,6 +1271,7 @@ void ActivityView::_Refresh() { bigtime_t lastTimeout = system_time() - fRefreshInterval; + BMessenger target(this); while (true) { status_t status = acquire_sem_etc(fRefreshSem, 1, B_ABSOLUTE_TIMEOUT, @@ -1297,11 +1298,8 @@ ActivityView::_Refresh() bigtime_t now = info.Time(); if (fLastRefresh + fDrawInterval <= now) { - if (LockLooper()) { - Invalidate(); - UnlockLooper(); - fLastRefresh = now; - } + target.SendMessage(B_INVALIDATE); + fLastRefresh = now; } } }