Show
Ignore:
Timestamp:
02/09/08 15:29:43 (1 year ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Implemented RunnableLock?. Thanks torhu for the testcase.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/widgets/RunnableLock.d

    r57 r101  
    1616import dwt.dwthelper.Runnable; 
    1717import tango.core.Exception; 
     18import tango.core.sync.Condition; 
     19import tango.core.sync.Mutex; 
    1820 
    1921/** 
     
    2426 */ 
    2527 
    26 class RunnableLock
     28class RunnableLock : Mutex
    2729    Runnable runnable; 
    2830    Thread thread; 
    2931    Exception throwable; 
     32    Condition cond; 
    3033 
    3134this (Runnable runnable) { 
    3235    this.runnable = runnable; 
     36    this.cond = new Condition(this); 
    3337} 
    3438 
     
    4246} 
    4347 
    44 //PORTING_FIXME: How to emulate Java locking? 
    4548void notifyAll(){ 
     49    cond.notifyAll(); 
    4650} 
    47 //PORTING_FIXME: How to emulate Java locking? 
    4851void wait(){ 
     52    cond.wait(); 
    4953} 
    5054