Anonymous user
Nautical bell: Difference between revisions
→{{header|D}}: daemonize
(→{{header|D}}: updated output of test run) |
(→{{header|D}}: daemonize) |
||
Line 11:
class NauticalBell : Thread {
private shared bool stopped;
this() {
Line 34:
if (next.minute == time.minute &&
next.hour == time.hour) {
immutable bells =
writefln("%s : %d %s
setNextBellTime();
}
Line 43:
}
void stop()
this.stopped = true;
}
Line 50:
void main() {
auto bells = new NauticalBell();
bells.start();
try {
bells.join();
} catch (ThreadException e) {
writeln(e.msg);
}
}</lang>
{{out}}
|