Skip to content

Commit

Permalink
Make the generic instruction processor static.
Browse files Browse the repository at this point in the history
  • Loading branch information
timcassell committed Dec 31, 2024
1 parent d716974 commit a5588e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Package/UnityHelpers/2018.3/Internal/PromiseBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ internal static void ResetStaticState()
return;
}

s_instance.ResetProcessors();
ResetProcessors();
s_instance.ResetConfig();
s_instance = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ internal sealed partial class PromiseBehaviour
internal static SingleInstructionProcessor s_endOfFrameProcessor = new SingleInstructionProcessor(4);

// Generic processor for instructions that need to be called every frame potentially multiple times.
internal InstructionProcessorGroup _updateProcessor = new InstructionProcessorGroup(16);
internal static InstructionProcessorGroup s_genericProcessor = new InstructionProcessorGroup(16);

private static void SetTimeValues()
{
Expand All @@ -86,14 +86,14 @@ private void Init()
StartCoroutine(EndOfFrameRoutine());
}

private void ResetProcessors()
private static void ResetProcessors()
{
s_waitOneFrameProcessor.Clear();
s_updateProcessor.Clear();
s_lateUpdateProcessor.Clear();
s_fixedUpdateProcessor.Clear();
s_endOfFrameProcessor.Clear();
_updateProcessor.ResetProcessors();
s_genericProcessor.ResetProcessors();
}

private IEnumerator UpdateRoutine()
Expand All @@ -103,7 +103,7 @@ private IEnumerator UpdateRoutine()
yield return null;
SetTimeValues();
s_waitOneFrameProcessor.Process();
_updateProcessor.Process();
s_genericProcessor.Process();
}
}

Expand Down
2 changes: 1 addition & 1 deletion Package/UnityHelpers/2018.3/PromiseYieldExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void OnCompleted(Action continuation)
InternalHelper.ValidateIsOnMainThread(1);
var copy = this;
copy._continuation = continuation;
InternalHelper.PromiseBehaviour.Instance._updateProcessor.WaitFor(copy);
InternalHelper.PromiseBehaviour.s_genericProcessor.WaitFor(copy);
}

/// <summary>
Expand Down

0 comments on commit a5588e3

Please sign in to comment.