* Fixed unlocking the window before suspending the
tracker task thread, which got broken/removed in r40226. * Also fixed a race condition that the previous code had, which is that after unlocking the window, the task thread could be interrupted, the window could theoretically go away and the view be destroyed before the thread continues, but we still access/dereference the BView pointer. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40698 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -374,12 +374,14 @@ BStatusWindow::CheckCanceledOrPaused(thread_id thread)
|
||||
if (isPaused && view != NULL) {
|
||||
// say we are paused
|
||||
view->Invalidate();
|
||||
thread_id thread = view->Thread();
|
||||
|
||||
ASSERT(find_thread(NULL) == view->Thread());
|
||||
lock.Unlock();
|
||||
|
||||
// and suspend ourselves
|
||||
// we will get resumed from BStatusView::MessageReceived
|
||||
suspend_thread(view->Thread());
|
||||
ASSERT(find_thread(NULL) == thread);
|
||||
suspend_thread(thread);
|
||||
}
|
||||
|
||||
return wasCanceled;
|
||||
|
||||
Reference in New Issue
Block a user