-
-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 13727 - std.stdio.File not thread-safe
- Loading branch information
1 parent
ebc559e
commit ae51714
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); } | ||
} | ||
} | ||
|