xxxxxxxxxx
void main()
{ import core.stdc.math : sin;
import core.thread;
import std.stdio: write, writeln, writef, writefln;
class DerivedThread : Thread
{ double d;
this()
{
super(&run);
}
this( double a)
{
super(&run);
this.d = sin(a);
writeln(d);
this.getD();
}
private:
double getD(){
writeln(d);
return d;
}
void run()
{
// Derived thread running.
}
}
// create and start instances of each type
auto derived = new DerivedThread(22).start();
}