Skip to content

Commit

Permalink
Fix race condition in ThreadedTaskScheduler when adding tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Oct 4, 2023
1 parent ecc3ce5 commit bd42383
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion osu.Framework/Threading/ThreadedTaskScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected override void QueueTask(Task task)
{
tasks.Add(task);
}
catch (ObjectDisposedException)
catch (Exception ex) when (ex is InvalidOperationException or ObjectDisposedException)
{
// tasks may have been disposed. there's no easy way to check on this other than catch for it.
Logger.Log($"Task was queued for execution on a {nameof(ThreadedTaskScheduler)} ({name}) after it was disposed. The task will be executed inline.");
Expand Down

0 comments on commit bd42383

Please sign in to comment.