Skip to content

Commit

Permalink
Fixed|Mobile|libappfw: Mutex misuse in desktop build
Browse files Browse the repository at this point in the history
In the desktop build, the main thread does all the UI processing,
including drawing. The root mutex is intended to prevent the render
thread from accessing widgets while their state is changing.
  • Loading branch information
skyjake committed Jun 11, 2017
1 parent 6c3e265 commit 3bf846a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions doomsday/sdk/libappfw/src/widgets/dialogwidget.cpp
Expand Up @@ -581,24 +581,30 @@ int DialogWidget::exec(GuiRootWidget &root)
root.add(this);

prepare();

int result = 0;
try
{
#if defined (DENG_MOBILE)
// The subloop will likely access the root independently.
root.unlock();

#endif

result = d->subloop.exec();


#if defined (DENG_MOBILE)
root.lock();
#endif
}
catch (...)
{
#if defined (DENG_MOBILE)
// The lock needs to be reacquired in any case.
root.lock();
#endif
throw;
}

finish(result);
return result;
}
Expand Down

0 comments on commit 3bf846a

Please sign in to comment.