Simon Jakobi pushed to branch wip/sjakobi/nonmoving-gc-test-fixes at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • libraries/base/tests/listThreads1.hs
    ... ... @@ -2,5 +2,10 @@ module Main where
    2 2
     
    
    3 3
     import GHC.Conc.Sync
    
    4 4
     
    
    5
    +-- Regression test for the JS backend's ListThreadsOp, which used to omit the
    
    6
    +-- running thread. Whatever other threads the RTS has is irrelevant here.
    
    5 7
     main :: IO ()
    
    6
    -main = listThreads >>= print
    8
    +main = do
    
    9
    +  tid <- myThreadId
    
    10
    +  ts <- listThreads
    
    11
    +  print (tid `elem` ts)

  • libraries/base/tests/listThreads1.stdout
    1
    -[ThreadId 1]
    1
    +True

  • rts/js/thread.js
    ... ... @@ -110,6 +110,10 @@ function h$rts_getThreadId(t) { // returns a CULLong
    110 110
       RETURN_UBX_TUP2((t.tid / Math.pow(2,32))>>>0, (t.tid & 0xFFFFFFFF)>>>0);
    
    111 111
     }
    
    112 112
     
    
    113
    +function h$eq_thread(t1,t2) {
    
    114
    +  return t1 === t2 ? 1 : 0;
    
    115
    +}
    
    116
    +
    
    113 117
     function h$cmp_thread(t1,t2) {
    
    114 118
       if(t1.tid < t2.tid) return -1;
    
    115 119
       if(t1.tid > t2.tid) return 1;