# .skip. intermittently fails on Mono 2.10.2 on Mac 10.6.7 """ A simple example of creating threads. Note the use 'ref' to refer to a method instead of invoking it. """ use System.Threading class ThreadExample var _maxSeconds = 1.2f var _start as DateTime def main _start = DateTime.now t = Thread(ref .writeB) t.start while not .isFinished print 'a' stop t.join print print 'Finished.' def writeB while not .isFinished print 'b' stop get isFinished as bool return DateTime.now.subtract(_start).totalSeconds >= _maxSeconds