Skip to content

Commit

Permalink
Fix mono debugger thread block when wait for attach (#62175)
Browse files Browse the repository at this point in the history
* wait_for_attach change to gc safe mode

* change MONO_REQ_GC_SAFE_MODE to MONO_REQ_GC_UNSAFE_MODE
  • Loading branch information
srxqds authored Dec 2, 2021
1 parent da3a933 commit 7b0a6b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mono/mono/component/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
Expand Down

0 comments on commit 7b0a6b5

Please sign in to comment.