[Git][ghc/ghc][wip/js-staging] allow async exceptions to be thrown from outside a haskell thread

Luite Stegeman (@luite) gitlab at gitlab.haskell.org
Tue Oct 11 12:16:17 UTC 2022



Luite Stegeman pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
1ec975ca by Luite Stegeman at 2022-10-11T14:15:37+02:00
allow async exceptions to be thrown from outside a haskell thread

- - - - -


1 changed file:

- rts/js/thread.js


Changes:

=====================================
rts/js/thread.js
=====================================
@@ -240,11 +240,15 @@ function h$killThread(t, ex) {
       return h$stack ? h$stack[h$sp] : null;
     } else {
       t.excep.push([h$currentThread,ex]);
-      h$currentThread.interruptible = true;
-      h$sp += 2;
-      h$stack[h$sp-1] = h$r1;
-      h$stack[h$sp] = h$return;
-      return h$blockThread(h$currentThread,t,null);
+      if(h$currentThread) {
+        h$currentThread.interruptible = true;
+        h$sp += 2;
+        h$stack[h$sp-1] = h$r1;
+        h$stack[h$sp] = h$return;
+        return h$blockThread(h$currentThread,t,null);
+      } else {
+        return null;
+      }
     }
   }
 }



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1ec975cac75be10ac77b472550d7df4dabdb2da4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1ec975cac75be10ac77b472550d7df4dabdb2da4
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221011/ba6515e1/attachment-0001.html>


More information about the ghc-commits mailing list