Commit f832c312 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-02-08 14:36:21 by simonmar]

Fix bitrot in SMP code.
parent 5d895e50
/* ----------------------------------------------------------------------------
* $Id: SMP.h,v 1.1 1999/11/02 15:05:52 simonmar Exp $
* $Id: SMP.h,v 1.2 2001/02/08 14:36:21 simonmar Exp $
*
* (c) The GHC Team, 1999
*
......@@ -66,15 +66,15 @@
#define LOCK_CLOSURE(c) \
({ \
const StgInfoTable *__info; \
__info = &WHITEHOLE_info; \
__info = &stg_WHITEHOLE_info; \
do { \
XCHG(__info,((StgClosure *)(c))->header.info); \
} while (__info == &WHITEHOLE_info); \
} while (__info == &stg_WHITEHOLE_info); \
__info; \
})
#define LOCK_THUNK(__info) \
CMPXCHG(R1.cl->header.info, __info, &WHITEHOLE_info);
CMPXCHG(R1.cl->header.info, __info, &stg_WHITEHOLE_info);
#define ACQUIRE_LOCK(mutex) pthread_mutex_lock(mutex);
#define RELEASE_LOCK(mutex) pthread_mutex_unlock(mutex);
......
/* ----------------------------------------------------------------------------
* $Id: RtsAPI.c,v 1.24 2001/01/11 17:25:56 simonmar Exp $
* $Id: RtsAPI.c,v 1.25 2001/02/08 14:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-2001
*
......@@ -356,7 +356,7 @@ rts_evalLazyIO (HaskellObj p, unsigned int stack_size, /*out*/HaskellObj *ret)
return waitThread(tso, ret);
}
#if defined(PAR) || defined(SMP)
#if defined(PAR)
/*
Needed in the parallel world for non-Main PEs, which do not get a piece
of work to start with --- they have to humbly ask for it
......
/* -----------------------------------------------------------------------------
* $Id: StgMiscClosures.hc,v 1.62 2001/01/31 10:12:08 simonmar Exp $
* $Id: StgMiscClosures.hc,v 1.63 2001/02/08 14:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
......@@ -398,7 +398,7 @@ STGFUN(stg_BLACKHOLE_entry)
bdescr *bd = Bdescr(R1.p);
if (bd->back != (bdescr *)BaseReg) {
if (bd->gen->no >= 1 || bd->step->no >= 1) {
CMPXCHG(R1.cl->header.info, &BLACKHOLE_info, &WHITEHOLE_info);
CMPXCHG(R1.cl->header.info, &stg_BLACKHOLE_info, &stg_WHITEHOLE_info);
} else {
EXTFUN_RTS(stg_gc_enter_1_hponly);
JMP_(stg_gc_enter_1_hponly);
......@@ -447,7 +447,7 @@ STGFUN(stg_BLACKHOLE_BQ_entry)
bdescr *bd = Bdescr(R1.p);
if (bd->back != (bdescr *)BaseReg) {
if (bd->gen->no >= 1 || bd->step->no >= 1) {
CMPXCHG(R1.cl->header.info, &BLACKHOLE_info, &WHITEHOLE_info);
CMPXCHG(R1.cl->header.info, &stg_BLACKHOLE_info, &stg_WHITEHOLE_info);
} else {
EXTFUN_RTS(stg_gc_enter_1_hponly);
JMP_(stg_gc_enter_1_hponly);
......@@ -538,7 +538,7 @@ STGFUN(stg_CAF_BLACKHOLE_entry)
bdescr *bd = Bdescr(R1.p);
if (bd->back != (bdescr *)BaseReg) {
if (bd->gen->no >= 1 || bd->step->no >= 1) {
CMPXCHG(R1.cl->header.info, &CAF_BLACKHOLE_info, &WHITEHOLE_info);
CMPXCHG(R1.cl->header.info, &stg_CAF_BLACKHOLE_info, &stg_WHITEHOLE_info);
} else {
EXTFUN_RTS(stg_gc_enter_1_hponly);
JMP_(stg_gc_enter_1_hponly);
......
/* -----------------------------------------------------------------------------
* $Id: Storage.h,v 1.25 2001/01/29 17:23:41 simonmar Exp $
* $Id: Storage.h,v 1.26 2001/02/08 14:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -103,6 +103,13 @@ extern void markCafs( void );
-------------------------------------------------------------------------- */
/*
* Storage manager mutex
*/
#ifdef SMP
extern pthread_mutex_t sm_mutex;
#endif
/* ToDo: shouldn't recordMutable and recordOldToNewPtrs acquire some
* kind of lock in the SMP case?
*/
......
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