Commit 199b5c07 authored by sof's avatar sof
Browse files

[project @ 2002-02-08 03:44:01 by sof]

declare MainCapability + simplify releaseCapability()
parent b6ed8e7c
......@@ -22,6 +22,9 @@
#include "RtsUtils.h"
#include "Capability.h"
#if !defined(SMP)
Capability MainCapability; /* for non-SMP, we have one global capability */
#endif
static
void
......@@ -69,11 +72,11 @@ void grabCapability(Capability** cap)
#endif
}
void releaseCapability(Capability** cap)
void releaseCapability(Capability* cap)
{
#if defined(SMP)
(*cap)->link = free_capabilities;
free_capabilities = *cap;
cap->link = free_capabilities;
free_capabilities = cap;
rts_n_free_capabilities++;
#endif
return;
......
......@@ -25,12 +25,12 @@
/* ToDo: assume that RtsFlags.h has been included at usage sites of Capability.h? */
#if !defined(SMP)
Capability MainCapability;
extern Capability MainCapability;
#endif
extern void initCapabilities(void);
extern void grabCapability(Capability** cap);
extern void releaseCapability(Capability** cap);
extern void releaseCapability(Capability* cap);
#if defined(SMP)
extern nat rts_n_free_capabilities; /* total number of available capabilities */
......
/* ---------------------------------------------------------------------------
* $Id: Schedule.c,v 1.119 2002/02/07 06:33:20 sof Exp $
* $Id: Schedule.c,v 1.120 2002/02/08 03:44:01 sof Exp $
*
* (c) The GHC Team, 1998-2000
*
......@@ -1524,7 +1524,7 @@ suspendThread( StgRegTable *reg )
tok = cap->r.rCurrentTSO->id;
/* Hand back capability */
releaseCapability(&cap);
releaseCapability(cap);
#if defined(RTS_SUPPORTS_THREADS) && !defined(SMP)
/* Preparing to leave the RTS, so ensure there's a native thread/task
......
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