patch applied (ghc): fix a deadlock in atomicModifyMutVar#

David Himmelstrup lemmih at gmail.com
Wed Feb 22 08:57:11 EST 2006


Tue Feb 21 08:37:11 PST 2006  Simon Marlow <simonmar at microsoft.com>
  * 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.

    M ./ghc/includes/Storage.h +1
    M ./ghc/rts/PrimOps.cmm -2 +2
    M ./ghc/rts/Storage.c -1 +6


More information about the Cvs-ghc mailing list