From: simonmar Date: Fri, 25 Jan 2002 12:22:27 +0000 (+0000) Subject: [project @ 2002-01-25 12:22:27 by simonmar] X-Git-Tag: Approximately_9120_patches~256 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e0ca9137b8fb8d176ba54073428ec739813c0073;p=ghc-hetmet.git [project @ 2002-01-25 12:22:27 by simonmar] Fix tryTakeMVar - amazingly it only worked with an empty MVar, and this was the only case I tested. oops. Merge to stable. --- diff --git a/ghc/rts/PrimOps.hc b/ghc/rts/PrimOps.hc index 083031a..d386f84 100644 --- a/ghc/rts/PrimOps.hc +++ b/ghc/rts/PrimOps.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.hc,v 1.87 2001/12/06 13:05:03 sewardj Exp $ + * $Id: PrimOps.hc,v 1.88 2002/01/25 12:22:27 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -1163,19 +1163,18 @@ FN_(tryTakeMVarzh_fast) /* unlock in the SMP case */ SET_INFO(mvar,&stg_FULL_MVAR_info); #endif - TICK_RET_UNBOXED_TUP(1); - RET_P(val); } else { /* No further putMVars, MVar is now empty */ + mvar->value = (StgClosure *)&stg_END_TSO_QUEUE_closure; /* do this last... we might have locked the MVar in the SMP case, * and writing the info pointer will unlock it. */ SET_INFO(mvar,&stg_EMPTY_MVAR_info); - mvar->value = (StgClosure *)&stg_END_TSO_QUEUE_closure; - TICK_RET_UNBOXED_TUP(1); - RET_P(val); } + + TICK_RET_UNBOXED_TUP(1); + RET_NP((I_)1, val); FE_ }