mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-07-02 05:45:00 +00:00
Better fix for macOS deadlock
Fix it in glfw. Dont hold the tick lock when calling the tick callback as the tick callback might be waiting on a lock.
This commit is contained in:
parent
61c4f80e90
commit
ae4a13b249
1 changed files with 7 additions and 4 deletions
|
|
@ -1020,12 +1020,15 @@ static NSLock *tick_lock = NULL;
|
|||
|
||||
void _glfwDispatchTickCallback(void) {
|
||||
if (tick_lock && tick_callback) {
|
||||
[tick_lock lock];
|
||||
while(tick_callback_requested) {
|
||||
while(true) {
|
||||
bool do_call = true;
|
||||
[tick_lock lock];
|
||||
if (!tick_callback_requested) do_call = false;
|
||||
tick_callback_requested = false;
|
||||
tick_callback(tick_callback_data);
|
||||
[tick_lock unlock];
|
||||
if (do_call) tick_callback(tick_callback_data);
|
||||
else break;
|
||||
}
|
||||
[tick_lock unlock];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue