public void Dispose()
            {
                var mre = new ManualResetEventSlim();

                SempahoreStateMachine.SendAsync(-1, CancellationToken).GetAwaiter().OnCompleted(() => mre.Set());

                mre.Wait(CancellationToken.None);
            }
 public async Task EnterAsync()
 {
     await SempahoreStateMachine.SendAsync(1, CancellationToken);
 }