Fixes issue #306 async/await hang (#312)

* Fixed async/await hang

* Fixed async/await hang with calling Wakeup

* Moved Wake Up into lock statement
This commit is contained in:
BDisp
2020-02-29 16:45:29 +00:00
parent 638ccfd364
commit 92ffa10a31
2 changed files with 4 additions and 2 deletions

View File

@@ -1717,7 +1717,7 @@ namespace Terminal.Gui {
public override void Post (SendOrPostCallback d, object state)
{
mainLoop.AddIdle (() => {
mainLoop.AddIdle (() => {
d (state);
return false;
});

View File

@@ -354,8 +354,10 @@ namespace Mono.Terminal {
/// </summary>
public Func<bool> AddIdle (Func<bool> idleHandler)
{
lock (idleHandlers)
lock (idleHandlers) {
idleHandlers.Add (idleHandler);
driver.Wakeup ();
}
return idleHandler;
}