From 39dbe3c248127823253abb68c4b2384ec9b917e2 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 17 Dec 2003 12:17:18 +0000 Subject: [PATCH] [project @ 2003-12-17 12:17:18 by simonmar] Fix up following changes to the Capability API. (strange, I'm *sure* I tested this stuff...) --- ghc/rts/RtsAPI.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ghc/rts/RtsAPI.c b/ghc/rts/RtsAPI.c index 2052f3d..d79da3d 100644 --- a/ghc/rts/RtsAPI.c +++ b/ghc/rts/RtsAPI.c @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- - * $Id: RtsAPI.c,v 1.50 2003/11/12 17:49:08 sof Exp $ + * $Id: RtsAPI.c,v 1.51 2003/12/17 12:17:18 simonmar Exp $ * * (c) The GHC Team, 1998-2001 * @@ -494,13 +494,13 @@ void rts_lock() { #ifdef RTS_SUPPORTS_THREADS - ACQUIRE_LOCK(&sched_mutex); + ACQUIRE_LOCK(&sched_mutex); - // we request to get the capability immediately, in order to - // a) stop other threads from using allocate() - // b) wake the current worker thread from awaitEvent() - // (so that a thread started by rts_eval* will start immediately) - grabReturnCapability(&sched_mutex,&rtsApiCapability); + // we request to get the capability immediately, in order to + // a) stop other threads from using allocate() + // b) wake the current worker thread from awaitEvent() + // (so that a thread started by rts_eval* will start immediately) + waitForReturnCapability(&sched_mutex,&rtsApiCapability); #endif } @@ -508,8 +508,9 @@ void rts_unlock() { #ifdef RTS_SUPPORTS_THREADS - if(rtsApiCapability) + if (rtsApiCapability) { releaseCapability(rtsApiCapability); + } rtsApiCapability = NULL; RELEASE_LOCK(&sched_mutex); #endif -- 1.7.10.4