Skip to content

Commit

Permalink
Update threadpool callback error messages to fix dotnet/runtime#38803
Browse files Browse the repository at this point in the history
EDIT: Simple test case to trigger an error:
```csharp
        ThreadPool.QueueUserWorkItem((_) => {
            throw new Exception("test");
        });
        var t = typeof(System.Threading.ThreadPool);
        var m = t.GetMethod("PumpThreadPool", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
        m.Invoke(null, null);
```
  • Loading branch information
kg committed Jul 28, 2020
1 parent fbe6a96 commit de7e2b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mono/mini/mini-wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,13 +604,13 @@ tp_cb (void)
mono_runtime_try_invoke (method, NULL, NULL, &exc, error);

if (!is_ok (error)) {
printf ("tp callback failed due to %s\n", mono_error_get_message (error));
printf ("ThreadPool Callback failed due to error: %s\n", mono_error_get_message (error));
mono_error_cleanup (error);
}

if (exc) {
char *type_name = mono_type_get_full_name (mono_object_class (exc));
printf ("tp callback threw a %s\n", type_name);
printf ("ThreadPool Callback threw an unhandled exception of type %s\n", type_name);
g_free (type_name);
}
}
Expand Down

0 comments on commit de7e2b2

Please sign in to comment.