From 9dcb4b4f7cb532455d003ecd2435b098fa0499d2 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft" Date: Mon, 11 Dec 2006 12:32:15 +0000 Subject: [PATCH] Mention that throwTo does not guarantee promptness of delivery --- GHC/Conc.lhs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index 9e09672..466b2e7 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -242,6 +242,11 @@ is received by the target thread. The trade-off is discussed in Section 8 of th Like any blocking operation, 'throwTo' is therefore interruptible (see Section 4.3 of the paper). +There is currently no guarantee that the exception delivered by 'throwTo' will be +delivered at the first possible opportunity. In particular, if a thread may +unblock and then re-block exceptions (using 'unblock' and 'block') without receiving +a pending 'throwTo'. This is arguably undesirable behaviour. + -} throwTo :: ThreadId -> Exception -> IO () throwTo (ThreadId id) ex = IO $ \ s -> -- 1.7.10.4