mirror of
https://review.haiku-os.org/haiku
synced 2025-02-22 21:48:35 +01:00
* 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:
parent
7581d0b224
commit
7d805b2d52
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user