ecere,ecereCOM: support Emscriptem platform. add new Emscripten interface driver.
[sdk] / ecere / src / sys / Condition.ec
index b64e8bd..23a6c8c 100644 (file)
@@ -1,18 +1,31 @@
 #if defined(BUILDING_ECERE_COM)
+#if !defined(__EMSCRIPTEN__)
 import "Semaphore"
 #else
 import "ecere"
 #endif
+#else
+import "ecere"
+#endif
+
+#if !defined(__EMSCRIPTEN__)
 
 public class Condition : struct
 {
-   char * name;
+   const char * name;
    Mutex lock { };
    int waiting;
    int signals;
    Semaphore waitSem { };
    Semaphore waitDone { };
 
+public:
+   property const char * name
+   {
+      set { name = value; }
+      get { return name; }
+   }
+
    void Signal()
    {
       lock.Wait();
@@ -49,3 +62,5 @@ public class Condition : struct
       mutex.Wait();
    }
 }
+
+#endif // !defined(__EMSCRIPTEN__)