| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #nullable disable
- namespace Terminal.Gui.App;
- ///// <summary>
- ///// provides the sync context set while executing code in Terminal.Gui, to let
- ///// users use async/await on their code
- ///// </summary>
- //internal sealed class MainLoopSyncContext : SynchronizationContext
- //{
- // public override SynchronizationContext CreateCopy () { return new MainLoopSyncContext (); }
- // public override void Post (SendOrPostCallback d, object state)
- // {
- // // Queue the task using the modern architecture
- // ApplicationImpl.Instance.Invoke (() => { d (state); });
- // }
- // //_mainLoop.Driver.Wakeup ();
- // public override void Send (SendOrPostCallback d, object state)
- // {
- // if (Thread.CurrentThread.ManagedThreadId == Application.MainThreadId)
- // {
- // d (state);
- // }
- // else
- // {
- // var wasExecuted = false;
- // ApplicationImpl.Instance.Invoke (
- // () =>
- // {
- // d (state);
- // wasExecuted = true;
- // }
- // );
- // while (!wasExecuted)
- // {
- // Thread.Sleep (15);
- // }
- // }
- // }
- //}
|