diff org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/RunnableLock.d @ 38:2e09b0e6857a

work on phobosfication
author Frank Benoit <benoit@tionex.de>
date Wed, 25 Mar 2009 11:18:25 +0100
parents 52184e4b815c
children 9f4c18c268b2
line wrap: on
line diff
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/RunnableLock.d	Wed Mar 25 08:46:48 2009 +0100
+++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/RunnableLock.d	Wed Mar 25 11:18:25 2009 +0100
@@ -14,8 +14,12 @@
 
 import java.lang.all;
 import java.lang.Thread;
-import tango.core.sync.Condition;
-import tango.core.sync.Mutex;
+version(Tango){
+    import tango.core.sync.Condition;
+    import tango.core.sync.Mutex;
+} else { // Phobos
+    alias Object Mutex; //FIXME, this is just a dummy because of Mutex missing
+}
 
 /**
  * Instances of this class are used to ensure that an
@@ -28,27 +32,42 @@
     Runnable runnable;
     Thread thread;
     Exception throwable;
-    Condition cond;
+    version(Tango){
+        Condition cond;
+    } else { // Phobos
+    }
 
-this (Runnable runnable) {
-    this.runnable = runnable;
-    this.cond = new Condition(this);
-}
+    this (Runnable runnable) {
+        this.runnable = runnable;
+        version(Tango){
+            this.cond = new Condition(this);
+        } else { // Phobos
+            implMissing( __FILE__, __LINE__ );
+        }
+    }
 
-bool done () {
-    return runnable is null || throwable !is null;
-}
+    bool done () {
+        return runnable is null || throwable !is null;
+    }
 
-void run () {
-    if (runnable !is null) runnable.run ();
-    runnable = null;
-}
+    void run () {
+        if (runnable !is null) runnable.run ();
+        runnable = null;
+    }
 
-void notifyAll(){
-    cond.notifyAll();
-}
-void wait(){
-    cond.wait();
-}
+    void notifyAll(){
+        version(Tango){
+            cond.notifyAll();
+        } else { // Phobos
+            implMissing( __FILE__, __LINE__ );
+        }
+    }
+    void wait(){
+        version(Tango){
+            cond.wait();
+        } else { // Phobos
+            implMissing( __FILE__, __LINE__ );
+        }
+    }
 
 }