Add EcoreMainLoop.IsMainThread to check the main loop thread
authorWonYoung Choi <wy80.choi@samsung.com>
Fri, 28 Oct 2016 04:56:53 +0000 (13:56 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Fri, 28 Oct 2016 05:39:35 +0000 (14:39 +0900)
EcoreMainLoop.IsMainThread returns true when the main loop is running
in current thread.

Change-Id: I1a189c6fa233fc7be4f14b8a2c4091852ddbe172

packaging/elm-sharp.spec
src/ElmSharp/ElmSharp.Net45.csproj
src/ElmSharp/ElmSharp.csproj
src/ElmSharp/ElmSharp/EcoreMainloop.cs
src/ElmSharp/Interop/Interop.Eina.cs [new file with mode: 0644]

index 34587e61707f06b7d0f8e72b2fba6e2ff7b6c330..e05a391c5fc443b990eaf74eafff3e285e061d49 100644 (file)
@@ -8,7 +8,7 @@
 
 Name:       elm-sharp
 Summary:    C# Binding for Elementary
-Version:    1.0.9
+Version:    1.0.10
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
index 4da7745a4a88b66522f39e31f962e42225d35a13..6bc1650ab4076a0160929f5489f28435a2ce8b5f 100644 (file)
     <Compile Include="ElmSharp\Window.cs" />
     <Compile Include="ElmSharp\WrapType.cs" />
     <Compile Include="Interop\Interop.Ecore.cs" />
+    <Compile Include="Interop\Interop.Eina.cs" />
     <Compile Include="Interop\Interop.Elementary.Bg.cs" />
     <Compile Include="Interop\Interop.Elementary.Box.cs" />
     <Compile Include="Interop\Interop.Elementary.Button.cs" />
index 848a2e1442aa58c7277831938b3177ef52f08774..df61891a60e548034369edda17c8821d99b3d5bf 100644 (file)
     <Compile Include="ElmSharp\Widget.cs" />
     <Compile Include="ElmSharp\Window.cs" />
     <Compile Include="ElmSharp\WrapType.cs" />
+    <Compile Include="Interop\Interop.Eina.cs" />
     <Compile Include="Interop\Interop.Eo.cs" />
     <Compile Include="Interop\Interop.Ecore.cs" />
     <Compile Include="Interop\Interop.Elementary.Bg.cs" />
index 048442d4ea514f3fb867e5b7c3aa453503eb5d83..1aabdcbe3f3f17d097e8e7c260172afcae6ae1b2 100644 (file)
@@ -9,7 +9,6 @@ namespace ElmSharp
         static readonly Object _taskLock = new Object();
         static int _newTaskId = 0;
 
-
         static Interop.Ecore.EcoreTaskCallback _nativeHandler;
 
         static EcoreMainloop()
@@ -19,6 +18,8 @@ namespace ElmSharp
             _nativeHandler = NativeHandler;
         }
 
+        public static bool IsMainThread => Interop.Eina.eina_main_loop_is();
+
         public static void Begin()
         {
             Interop.Ecore.ecore_main_loop_begin();
diff --git a/src/ElmSharp/Interop/Interop.Eina.cs b/src/ElmSharp/Interop/Interop.Eina.cs
new file mode 100644 (file)
index 0000000..107d4c3
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eina
+    {
+        [DllImport(Libraries.Eina)]
+        internal static extern bool eina_main_loop_is();
+    }
+}