Proposed fix for the Task::Start() hang on macOS
Patrick Luby
plubius at neooffice.org
Fri Dec 23 19:30:33 UTC 2022
Bugzilla has a large number of open macOS hanging bugs like this one:
https://bugs.documentfoundation.org/show_bug.cgi?id=148435
I finally figured out what causing all these hangs in Task::Start() and
posted a patch that hopefully should fix these bugs:
https://gerrit.libreoffice.org/c/core/+/144786
The fix is quite simple - switch the scheduler mutex from std::mutex to
std::recursive_mutex - but I wanted other developers more familiar with
the scheduler to take a look at my patch.
Specifically, I now know that macOS accessibility, screen changes, and
maybe other events are dispatched while in
Scheduler::CallbackTaskScheduling()'s call to Application::AnyInput()
and those native events can call vcl code that, in turn, calls
Task::Start().
So, here is my question for other developers: is Task::Start() safe to
call in this particular scenario? My patch assumes it is but if it
isn't, please let me know and will try to write a patch that skips or
defers calls to Task::Start() if the scheduler mutex is already locked
by the current thread.
Patrick
More information about the LibreOffice
mailing list