Commit e0ca9137 authored by simonmar's avatar simonmar
Browse files

[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.
parent 893a774d
/* -----------------------------------------------------------------------------
* $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_
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment