fix a deadlock in atomicModifyMutVar#
authorSimon Marlow <simonmar@microsoft.com>
Tue, 21 Feb 2006 16:37:11 +0000 (16:37 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Tue, 21 Feb 2006 16:37:11 +0000 (16:37 +0000)
commit25cc1d1f2d9bf9a83725e49884bd83ab35000e3e
treee71f81e7dc19e013ef949cb94f8a5b524de4dbc3
parent5d9f7faf4c6519af8da750919c986ffcda660030
fix a deadlock in atomicModifyMutVar#

atomicModifyMutVar# was re-using the storage manager mutex (sm_mutex)
to get its atomicity guarantee in SMP mode. But recently the addition
of a call to dirty_MUT_VAR() to implement the read barrier lead to a
rare deadlock case, because dirty_MUT_VAR() very occasionally needs to
allocate a new block to chain on the mutable list, which requires
sm_mutex.
ghc/includes/Storage.h
ghc/rts/PrimOps.cmm
ghc/rts/Storage.c