<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.84.1-preview" />

Microsoft.Identity.Client.Extensions.Msal.CrossPlatLock

public sealed class CrossPlatLock : IDisposable
A cross-process lock that works on all platforms, implemented using files. Does not ensure thread safety, i.e. 2 threads from the same process will pass through this lock.
public CrossPlatLock(string lockfilePath, int lockFileRetryDelay = 100, int lockFileRetryCount = 600)

Creates a file lock and maintains it until the lock is disposed. Any other process trying to get the lock will wait (spin waiting) until the lock is released. Works on Windows, Mac and Linux.

public void Dispose()

Releases the lock