Skip to content

Commit

Permalink
Merge pull request ppy#4819 from peppy/fix-enqueue-action-from-dispos…
Browse files Browse the repository at this point in the history
…al-thread

Fix `EnqueueAction` randomly throwing if called from (async) disposal thread
  • Loading branch information
smoogipoo committed Oct 12, 2021
2 parents add396d + 36b0291 commit e33a447
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions osu.Framework/Audio/AudioComponent.cs
Expand Up @@ -35,15 +35,6 @@ public abstract class AudioComponent : IDisposable, IUpdateable
/// <returns>A task which can be used for continuation logic. May return a <see cref="Task.CompletedTask"/> if called while already on the audio thread.</returns>
protected Task EnqueueAction(Action action)
{
if (ThreadSafety.ExecutionMode == ExecutionMode.SingleThread)
{
if (ThreadSafety.IsDrawThread)
throw new InvalidOperationException("Cannot perform audio operation from draw thread.");

if (ThreadSafety.IsInputThread)
throw new InvalidOperationException("Cannot perform audio operation from input thread.");
}

if (CanPerformInline)
{
action();
Expand Down

0 comments on commit e33a447

Please sign in to comment.