[commit: ghc] ghc-8.4: Make System.IO.openTempFile thread-safe on Windows (2fc621d)

git at git.haskell.org git at git.haskell.org
Thu Jan 4 21:36:09 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.4
Link       : http://ghc.haskell.org/trac/ghc/changeset/2fc621df9200475c471cb62a0c30ce4eae2d1dcd/ghc

>---------------------------------------------------------------

commit 2fc621df9200475c471cb62a0c30ce4eae2d1dcd
Author: Tamar Christina <tamar at zhox.com>
Date:   Tue Jan 2 16:02:49 2018 -0500

    Make System.IO.openTempFile thread-safe on Windows
    
    This calls out to the Win32 API `GetTempFileName` to generate
    a temporary file. Using `uUnique = 0` guarantees that the file
    we get back is unique and the file is "reserved" by creating it.
    
    Test Plan:
    ./validate
    
    I can't think of any sensible tests that shouldn't run for a while
    to verify. So the example in #10731 was ran for a while and no
    collisions in new code
    
    Reviewers: hvr, bgamari, erikd
    
    Reviewed By: bgamari
    
    Subscribers: RyanGlScott, rwbarton, thomie, carter
    
    GHC Trac Issues: #10731
    
    Differential Revision: https://phabricator.haskell.org/D4278
    
    (cherry picked from commit 46287af0911f7cb446c62850630f85af567ac512)


>---------------------------------------------------------------

2fc621df9200475c471cb62a0c30ce4eae2d1dcd
 libraries/base/System/IO.hs       | 96 +++++++++++++++++++++++++--------------
 libraries/base/cbits/Win32Utils.c | 43 ++++++++++++++++++
 libraries/base/changelog.md       |  3 ++
 3 files changed, 109 insertions(+), 33 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2fc621df9200475c471cb62a0c30ce4eae2d1dcd


More information about the ghc-commits mailing list