From f4769328c5643a7b236d63d5f269b2d9c0935951 Mon Sep 17 00:00:00 2001 From: Seungkeun Lee Date: Tue, 1 Nov 2016 08:43:06 +0900 Subject: Fix BeginInvokeOnMainThread - If current thread is main thread, directly call instead of post - Rollback SynchronizationContext - Add IsInvokedREquired implementation Change-Id: Ia00c9ca80038d6aeca9a5e2a42e69aaa5073be64 --- Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs') diff --git a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs index ea7dbc0b..37354959 100644 --- a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs +++ b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs @@ -70,10 +70,7 @@ namespace Xamarin.Forms.Platform.Tizen private void HandleElapsed(object state) { - s_context.Post(delegate (object o) - { - SendSignals(-1); - }, null); + s_context.Post((o) => SendSignals(-1), null); } } @@ -104,7 +101,14 @@ namespace Xamarin.Forms.Platform.Tizen public void BeginInvokeOnMainThread(Action action) { - s_context.Post((o) => action(), null); + if (ElmSharp.EcoreMainloop.IsMainThread) + { + action(); + } + else + { + s_context.Post((o) => action(), null); + } } public Xamarin.Forms.Internals.Ticker CreateTicker() @@ -179,7 +183,7 @@ namespace Xamarin.Forms.Platform.Tizen { get { - return false; + return !ElmSharp.EcoreMainloop.IsMainThread; } } -- cgit v1.2.3