Skip to content

Commit

Permalink
Cygwin: revert use of CancelSyncronousIo on wait_thread.
Browse files Browse the repository at this point in the history
It appears this is causing hangs on native x86_64 in similar scenarios
as the hangs on ARM64.

Addresses: msys2/MSYS2-packages#4340
  • Loading branch information
jeremyd2019 committed Nov 22, 2024
1 parent 3cd8609 commit ad50c10
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions winsup/cygwin/sigproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,7 @@ proc_terminate ()
to 1 iff it is a Cygwin process. */
if (!have_execed || !have_execed_cygwin)
chld_procs[i]->ppid = 1;
/* Attempt to exit the wait_thread cleanly via CancelSynchronousIo
before falling back to the (explicitly dangerous) cross-thread
termination */
if (chld_procs[i].wait_thread
&& !CancelSynchronousIo (chld_procs[i].wait_thread->thread_handle ()))
if (chld_procs[i].wait_thread)
chld_procs[i].wait_thread->terminate_thread ();
/* Release memory associated with this process unless it is 'myself'.
'myself' is only in the chld_procs table when we've execed. We
Expand Down Expand Up @@ -1178,11 +1174,7 @@ remove_proc (int ci)
{
if (have_execed)
{
/* Attempt to exit the wait_thread cleanly via CancelSynchronousIo
before falling back to the (explicitly dangerous) cross-thread
termination */
if (_my_tls._ctinfo != chld_procs[ci].wait_thread
&& !CancelSynchronousIo (chld_procs[ci].wait_thread->thread_handle ()))
if (_my_tls._ctinfo != chld_procs[ci].wait_thread)
chld_procs[ci].wait_thread->terminate_thread ();
}
else if (chld_procs[ci] && chld_procs[ci]->exists ())
Expand Down

0 comments on commit ad50c10

Please sign in to comment.