Skip to content

[mono] call GC.Collect(); block the main thread won't resume #62128

@srxqds

Description

@srxqds

Description

i am embedding the monovm with ue.
i call GC.Collection will block the main thread.

Reproduction Steps

our code is simple:

// call from native use mono_runtime_invoke
public void Unload(IPlugin plugin)
{
    plugin.Clear();  // do some clear work
    GC.Collect();
    plugin.Unload();
}

this is the thread call stack:

image

Expected behavior

no block

Actual behavior

work correctly

Regression?

No response

Known Workarounds

No response

Configuration

build latest release/6.0
windows x64

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions