Mercurial > projects > dwt-linux
diff dwt/internal/Lock.d @ 54:8f049b136add
first example working
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Jan 2008 14:31:37 +0100 |
parents | 63c023465156 |
children | 8cec8f536af3 |
line wrap: on
line diff
--- a/dwt/internal/Lock.d Fri Jan 11 11:21:52 2008 +0100 +++ b/dwt/internal/Lock.d Fri Jan 11 14:31:37 2008 +0100 @@ -23,7 +23,7 @@ Mutex mutex; Condition cond; - public this(){ + public this() { mutex = new Mutex; cond = new Condition(mutex); } @@ -37,7 +37,7 @@ public int lock() { synchronized (mutex) { Thread current = Thread.getThis(); - if (owner != current) { + if (owner !is current) { waitCount++; while (count > 0) { try { @@ -60,8 +60,8 @@ public void unlock() { synchronized (mutex) { Thread current = Thread.getThis(); - if (owner == current) { - if (--count == 0) { + if (owner is current) { + if (--count is 0) { owner = null; if (waitCount > 0) cond.notifyAll(); }