[commit: ghc] master: Raise exceptions when blocked in bad FDs (fixes Trac #4934) (9fd507e)

git at git.haskell.org git at git.haskell.org
Sun Jun 8 10:21:50 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9fd507e5758f4141ac2619f0db57136bcab035c6/ghc

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

commit 9fd507e5758f4141ac2619f0db57136bcab035c6
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Fri May 23 23:58:06 2014 +0300

    Raise exceptions when blocked in bad FDs (fixes Trac #4934)
    
    Before the patch any call to 'select()' with 'bad_fd' led to:
    - unblocking of all threads
    - hiding exception for 'threadWaitRead bad_fd'
    
    The patch fixes both cases in this way:
    after 'select()' failure we iterate over each blocked descriptor
    and poll individually to see it's actual status, which is:
    - READY (move to run queue)
    - BLOCKED (leave in blocked queue)
    - INVALID (send an IOErrror exception)
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>


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

9fd507e5758f4141ac2619f0db57136bcab035c6
 libraries/base/GHC/Event/Thread.hs |   6 +-
 rts/Prelude.h                      |   2 +
 rts/RtsStartup.c                   |   1 +
 rts/package.conf.in                |   2 +
 rts/posix/Select.c                 | 179 +++++++++++++++++++++++++++----------
 rts/win32/libHSbase.def            |   3 +-
 6 files changed, 144 insertions(+), 49 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 9fd507e5758f4141ac2619f0db57136bcab035c6


More information about the ghc-commits mailing list