TDPL message passing: OwnerFailed?
monarch_dodra
monarchdodra at gmail.com
Tue Jan 22 09:04:45 PST 2013
On Tuesday, 22 January 2013 at 15:01:59 UTC, monarch_dodra wrote:
>
> TY. Gonna read everything.
I'm not enjoying this.
I'm getting some errors with this program:
//----
import std.stdio, std.file;
import std.concurrency;
void main(string[] args)
{
auto iFile = File("input.txt", "r");
spawn(&fileWriter, "out1.txt");
spawn(&fileWriter, "out2.txt");
}
void fileWriter(string fileName)
{
File oFile = File(fileName, "w");
}
//----
There's a 50/50 chances it produces:
//----
std.exception.ErrnoException at std\stdio.d(467): Could not close
file `input.txt' (No error)
//----
Always on the input files, never the outputs
I'm using a win32 dmd on win7_64.
The line in stdoo is:
//----
errnoEnforce(.fclose(_p.handle) == 0,
"Could not close file `"~_name~"'");
//----
I'd be tempted to say this is a bug... Maybe not a dmd/phobos
bug, but I'm not sure how to work around it.
More information about the Digitalmars-d-learn
mailing list