Stanislav Blinov:
You'd also have to synchronize access to id member,
I forgot to note that both synchronized {} blocks should also
be synchronizing on the same mutex.
The mutex could be emulated with a shared bool and
std.atomic.cas(). That would get rid of synchronized{} blocks
and would potentionally be faster.
This is the current D entry:
http://rosettacode.org/wiki/Rendezvous#D
If you have bug fixes, or improvements, it's better to do them
right there. Of if you don't want to register on that site, you
can put the modified version in dpaste, and I'll upload it on
Rosettacode.
Bye,
bearophile