xxxxxxxxxx
import std.concurrency;
import std.stdio;
class SuperUsefulThing
{
private int _value;
this() { _value = 0; }
int read() { return _value; }
void write(int value) { _value = value; }
}
void main()
{
auto myNotSharedObject = new SuperUsefulThing();
myNotSharedObject.write(7);
static void otherThread(SuperUsefulThing t)
{
t.read();
t.write(1234);
}
spawn(&otherThread, myNotSharedObject);
writeln(myNotSharedObject.read());
}