<PackageReference Include="Microsoft.Identity.Client" Version="4.83.3" />

Microsoft.Identity.Client.Utils.MacMainThreadScheduler

public class MacMainThreadScheduler
This class implements a main thread scheduler for macOS applications. It should be also working on other platforms, but it is primarily designed for macOS. It is mainly designed for internal use to support the MSAL library in "switching to the main thread anytime". However, external users can also call it if needed.
namespace Microsoft.Identity.Client.Utils { public class MacMainThreadScheduler { public static MacMainThreadScheduler Instance(); public bool IsCurrentlyOnMainThread(); public bool IsRunning(); public void Stop(); public Task RunOnMainThreadAsync(Func<Task> asyncAction); public void StartMessageLoop(); } }