Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d75d3a2

Browse files
greglucasQuLogic
authored andcommitted
Merge pull request #27755 from ksunden/release_gil_macos_event_loop
Allow threads during macos event loop (cherry picked from commit b50843d)
1 parent 03947d0 commit d75d3a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/_macosx.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ int mpl_check_modifier(
547547
close(channel[0]);
548548
}
549549

550+
Py_BEGIN_ALLOW_THREADS
551+
550552
NSDate* date =
551553
(timeout > 0.0) ? [NSDate dateWithTimeIntervalSinceNow: timeout]
552554
: [NSDate distantFuture];
@@ -559,6 +561,8 @@ int mpl_check_modifier(
559561
[NSApp sendEvent: event];
560562
}
561563

564+
Py_END_ALLOW_THREADS
565+
562566
if (py_sigint_handler) { PyOS_setsig(SIGINT, py_sigint_handler); }
563567
if (sigint_socket) { CFSocketInvalidate(sigint_socket); }
564568
if (!error) { close(channel[1]); }

0 commit comments

Comments
 (0)