Threads
Spacen Jasset
spacenjasset at yahoo.co.uk
Wed Nov 19 10:34:41 PST 2008
DF wrote:
> /**
> * Testing.
> */
> module Test;
>
> import std.thread;
> import std.stdio;
>
> class DerivedThread : Thread {
>
> this() {
> super(&run);
> }
>
> private :
> int run() {
> writefln("Derived thread running.\n" );
> return 0;
> }
> }
>
> void main() {
> Thread derived = new DerivedThread();
> derived.start();
> }
>
> This code makes no output. Why?
Not quite sure, but you could try derived.wait() in main to wait for the
thread to finish.
More information about the Digitalmars-d
mailing list