[Issue 13727] std.stdio.File not thread-safe

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 28 08:28:53 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=13727

Jonathan Marler <johnnymarler at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |johnnymarler at gmail.com

--- Comment #17 from Jonathan Marler <johnnymarler at gmail.com> ---
The new `build.d` script in dmd is running into these issues.  I simplified
where it's getting stuck into 3 versions with this code snippet:

import std.stdio, std.algorithm, std.array, std.process, std.exception,
std.parallelism;
void main()
{
    auto funcs = [() {
        // std.exception.ErrnoException at std\stdio.d(997): Enforcement failed
(No error)
        version (a)
            ["git", "--version"].execute;
        // std.exception.ErrnoException at std\stdio.d(563): Could not close file
`HANDLE(C0)' (No error)
        else version (b)
            ["dir"].execute;
        // std.exception.ErrnoException at std\stdio.d(563): Could not close file
`somefile' (Bad file descriptor)
        else version (c)
            "bar".toFile("anotherfile");
        else static assert(0, "Please specify -version=a, -version=b or
-version=c");
    }, () {
        "foo".toFile("somefile");
    }];
    foreach (func; funcs.parallel(1))
        func();
}

--


More information about the Digitalmars-d-bugs mailing list