Commit 2fb746fd authored by thoughtpolice's avatar thoughtpolice
Browse files

Clarify docs for throwTo wrt atomicity (#8432)


Authored-by: default avatarBertram Felgenhauer <bertram.felgenhauer@gmail.com>
Signed-off-by: thoughtpolice's avatarAustin Seipp <aseipp@pobox.com>
parent 3ea4d5a6
......@@ -334,11 +334,12 @@ killThread tid = throwTo tid ThreadKilled
{- | 'throwTo' raises an arbitrary exception in the target thread (GHC only).
Exception delivery synchronizes between the source and target thread:
'throwTo' does not return until the exception has been raised in the
target thread.
The calling thread can thus be certain that the target
thread has received the exception. This is a useful property to know
when dealing with race conditions: eg. if there are two threads that
target thread. The calling thread can thus be certain that the target
thread has received the exception. Exception delivery is also atomic
with respect to other exceptions. Atomicity is a useful property to have
when dealing with race conditions: e.g. if there are two threads that
can kill each other, it is guaranteed that only one of the threads
will get to kill the other.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment