Skip to content

Commit

Permalink
fix Issue 13727 - std.stdio.File not thread-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed May 9, 2016
1 parent ebc559e commit ae51714
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/runnable/extra-files/extra13727.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It doesn't matter what this file contains, any old junk will do.
23 changes: 23 additions & 0 deletions test/runnable/test13727.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// https://issues.dlang.org/show_bug.cgi?id=13727

import std.array;
import std.parallelism;
import std.stdio;

void main()
{
foreach (fn;
["runnable/extra-files/extra13727.txt"]
.replicate(1000)
.parallel
)
{
// synchronized
version (Windows)
string mode = "rb";
else
string mode = "r";
{ File f = File(fn, mode); }
}
}

0 comments on commit ae51714

Please sign in to comment.