Make threading even more thread safe

This commit is contained in:
smoogipoo
2021-01-26 22:49:01 +09:00
parent 8c3b0a3167
commit 085115cba5
2 changed files with 55 additions and 31 deletions

View File

@ -21,9 +21,9 @@ namespace osu.Game.Extensions
/// Whether errors should be logged as errors visible to users, or as debug messages.
/// Logging as debug will essentially silence the errors on non-release builds.
/// </param>
public static void CatchUnobservedExceptions(this Task task, bool logAsError = false)
public static Task CatchUnobservedExceptions(this Task task, bool logAsError = false)
{
task.ContinueWith(t =>
return task.ContinueWith(t =>
{
Exception? exception = t.Exception?.AsSingular();
if (logAsError)