From: D.S. Qiu Date: Thu, 2 Dec 2021 00:54:58 +0000 (+0800) Subject: Fix mono debugger thread block when wait for attach (#62175) X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~12017 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b0a6b50cbedb30bd243a836e2b223806f4fc072;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix mono debugger thread block when wait for attach (#62175) * wait_for_attach change to gc safe mode * change MONO_REQ_GC_SAFE_MODE to MONO_REQ_GC_UNSAFE_MODE --- diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index 2cfd24d..98a51b3 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -10022,7 +10022,7 @@ cmd_to_string (CommandSet set, int command) static gboolean wait_for_attach (void) { - MONO_REQ_GC_SAFE_MODE; + MONO_REQ_GC_UNSAFE_MODE; #ifndef DISABLE_SOCKET_TRANSPORT if (listen_fd == -1) { @@ -10031,8 +10031,10 @@ wait_for_attach (void) } /* Block and wait for client connection */ + MONO_ENTER_GC_SAFE; conn_fd = socket_transport_accept (listen_fd); - + MONO_EXIT_GC_SAFE; + PRINT_DEBUG_MSG (1, "Accepted connection on %d\n", conn_fd); if (conn_fd == -1) { PRINT_DEBUG_MSG (1, "[dbg] Bad client connection\n");