From ad3b79d22b32760f25bf10069bd2957462be959d Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 8 Jul 2010 14:48:51 +0000 Subject: New asynchronous exception control API (ghc parts) As discussed on the libraries/haskell-cafe mailing lists http://www.haskell.org/pipermail/libraries/2010-April/013420.html This is a replacement for block/unblock in the asychronous exceptions API to fix a problem whereby a function could unblock asynchronous exceptions even if called within a blocked context. The new terminology is "mask" rather than "block" (to avoid confusion due to overloaded meanings of the latter). In GHC, we changed the names of some primops: blockAsyncExceptions# -> maskAsyncExceptions# unblockAsyncExceptions# -> unmaskAsyncExceptions# asyncExceptionsBlocked# -> getMaskingState# and added one new primop: maskUninterruptible# See the accompanying patch to libraries/base for the API changes. --- includes/rts/storage/Closures.h | 2 +- includes/stg/MiscClosures.h | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'includes') diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index 7671c7b47e..2683ce7d49 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -161,7 +161,7 @@ typedef struct _StgUpdateFrame { typedef struct { StgHeader header; - StgInt exceptions_blocked; + StgWord exceptions_blocked; StgClosure *handler; } StgCatchFrame; diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index 9b2bb600da..afe2623f1e 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -58,7 +58,9 @@ RTS_RET(stg_catch_retry_frame); RTS_RET(stg_atomically_frame); RTS_RET(stg_atomically_waiting_frame); RTS_RET(stg_catch_stm_frame); -RTS_RET(stg_unblockAsyncExceptionszh_ret); +RTS_RET(stg_unmaskAsyncExceptionszh_ret); +RTS_RET(stg_maskUninterruptiblezh_ret); +RTS_RET(stg_maskAsyncExceptionszh_ret); // RTS_FUN(stg_interp_constr_entry); // @@ -407,9 +409,10 @@ RTS_FUN_DECL(stg_forkzh); RTS_FUN_DECL(stg_forkOnzh); RTS_FUN_DECL(stg_yieldzh); RTS_FUN_DECL(stg_killThreadzh); -RTS_FUN_DECL(stg_asyncExceptionsBlockedzh); -RTS_FUN_DECL(stg_blockAsyncExceptionszh); -RTS_FUN_DECL(stg_unblockAsyncExceptionszh); +RTS_FUN_DECL(stg_getMaskingStatezh); +RTS_FUN_DECL(stg_maskAsyncExceptionszh); +RTS_FUN_DECL(stg_maskUninterruptiblezh); +RTS_FUN_DECL(stg_unmaskAsyncExceptionszh); RTS_FUN_DECL(stg_myThreadIdzh); RTS_FUN_DECL(stg_labelThreadzh); RTS_FUN_DECL(stg_isCurrentThreadBoundzh); -- cgit v1.2.1