Close the races between throwTo and thread completion
authorSimon Marlow <marlowsd@gmail.com>
Wed, 7 Jan 2009 14:05:07 +0000 (14:05 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 7 Jan 2009 14:05:07 +0000 (14:05 +0000)
commitea1ad23f58b5e45731b47a1d686c0dd73766e1b7
treedd73d2f2e1905b23f8f8f766d78b7840f73d2d03
parent9fd3a4f8760c7e47eb5d4a098559c980d24a9775
Close the races between throwTo and thread completion
Any threads we missed were being caught by the GC (possibly the idle
GC if the system was otherwise inactive), but that's not ideal.  The
fix (from Bertram Felgenhauer) is to use lockTSO to synchronise,
imposing an unconditional lockTSO on thread exit.  I couldn't measure
any performance overhead from doing this, so it seems reasonable.
rts/RaiseAsync.c
rts/Schedule.c