Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 13727 - std.stdio.File not thread-safe #5747

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

import std.parallelism;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

import std.stdio;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No!


void main()
{
foreach (fn;
["runnable/extra-files/extra13727.txt"]
.replicate(1000)
.parallel
)
{
// synchronized
version (Windows)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's with the weird indentation?

string mode = "rb";
else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

string mode = "r";
{ File f = File(fn, mode); }
}
}