Subject: Re: build aborts in regress/lib/libpthread/sem
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Marcus Comstedt <marcus@mc.pp.se>
List: port-dreamcast
Date: 02/17/2003 17:31:08
Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> writes:
> I see your point, but as you say I don't know a good way
> to suspend/resume interrupts with LOCK/UNLOCK macros.
> IMHO these suspend/resume pairs are not so excessive, though..
One way to do it is like this:
#define G2_LOCK \
do { \
int _s = _cpu_intr_suspend(); \
WAIT_G2DMA
#define G2_UNLOCK \
_cpu_intr_resume(_s); \
} while(/*CONSTCOND*/0)
Not terribly pretty, but in this limited context I think it's ok, and
it avoids unnecessary repetition.
// Marcus