Is stdout.flush() unsafe?

tsbockman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 29 01:57:40 PST 2015


Trying to compile this:

void main() @safe
{
     import std.stdio;
     stdout.flush();
}

Fails with this message:
> Error: safe function 'main' cannot access __gshared data 
> 'stdout'

Is this necessary? If so, what are the synchronization 
requirements for access to `stdout`?


More information about the Digitalmars-d-learn mailing list