Summary: std.stdio.write family blocks on file lock
In multi-threaded applications, File.LockingTextWriter is not correctly
locking/unlocking the underlying FILE* handle, resulting in deadlocks. The more
trace prints you put in to find the problem, the worse it gets.
The problem seems to be related to recent dmd bug-fixes, and I worked around it
with the following change. It looks like LockingTextWriter needs to be
revisited, maybe by reinstating the non-hacked implementation.
$ diff dmd/src/phobos/std/stdio.d stdio.d
< //return LockingTextWriter(this);
> return LockingTextWriter(this);
< auto result = LockingTextWriter(this);
< return result;
> //auto result = LockingTextWriter(this);
> //return result;