diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2013-09-08 22:10:50 -0400 |
---|---|---|
committer | Patrick Palka <patrick@parcs.ath.cx> | 2013-09-08 22:10:50 -0400 |
commit | 783ca393d9b262fe0efc6308e71c95a2da0eda1a (patch) | |
tree | d515913f550abc335500613a02c1311d6e12e341 /rts/PrimOps.cmm | |
parent | a58ba1856451447350132f20637deb898ebee252 (diff) | |
parent | 2cec084e45392e0b0d198254017b140accee32f0 (diff) | |
download | haskell-783ca393d9b262fe0efc6308e71c95a2da0eda1a.tar.gz |
Merge remote-tracking branch 'origin/master' into ghc-parmake-gsocghc-parmake-gsoc
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r-- | rts/PrimOps.cmm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 3cfec94b72..e278bb70ab 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -460,14 +460,6 @@ stg_addCFinalizzerToWeakzh ( W_ fptr, // finalizer { W_ c, info; - LOCK_CLOSURE(w, info); - - if (info == stg_DEAD_WEAK_info) { - // Already dead. - unlockClosure(w, info); - return (0); - } - ALLOC_PRIM (SIZEOF_StgCFinalizerList) c = Hp - SIZEOF_StgCFinalizerList + WDS(1); @@ -478,6 +470,14 @@ stg_addCFinalizzerToWeakzh ( W_ fptr, // finalizer StgCFinalizerList_eptr(c) = eptr; StgCFinalizerList_flag(c) = flag; + LOCK_CLOSURE(w, info); + + if (info == stg_DEAD_WEAK_info) { + // Already dead. + unlockClosure(w, info); + return (0); + } + StgCFinalizerList_link(c) = StgWeak_cfinalizers(w); StgWeak_cfinalizers(w) = c; |