2
0
Эх сурвалжийг харах

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

* Fixed async/await hang

* Fixed async/await hang with calling Wakeup

* Moved Wake Up into lock statement
BDisp 5 жил өмнө
parent
commit
0c72b8eae1

+ 1 - 1
Terminal.Gui/Core.cs

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

+ 3 - 1
Terminal.Gui/MonoCurses/mainloop.cs

@@ -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;
 		}