Commit 1828f852 authored by simonmar's avatar simonmar

[project @ 2006-01-18 10:31:50 by simonmar]

- fix a mixup in Capability.c regarding signals: signals_pending() is not
  used in THREADED_RTS

- some cleanups and warning removal while I'm here
parent 54fcddbe
# Initialise and check sanity.
AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.5], [glasgow-haskell-bugs@haskell.org], [ghc])
AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.5.20060117], [glasgow-haskell-bugs@haskell.org], [ghc])
AC_CONFIG_SRCDIR([ghc.spec.in])
# duplicate from ../configure.ac
......
......@@ -70,6 +70,30 @@ extern void _assertFail (char *, unsigned int);
#define doNothing() do { } while (0)
#ifdef SMP
#define USED_IF_SMP
#define USED_IF_NOT_SMP STG_UNUSED
#else
#define USED_IF_SMP STG_UNUSED
#define USED_IF_NOT_SMP
#endif
#ifdef DEBUG
#define USED_IF_DEBUG
#define USED_IF_NOT_DEBUG STG_UNUSED
#else
#define USED_IF_DEBUG STG_UNUSED
#define USED_IF_NOT_DEBUG
#endif
#ifdef THREADED_RTS
#define USED_IF_THREADS
#define USED_IF_NOT_THREADS STG_UNUSED
#else
#define USED_IF_THREADS STG_UNUSED
#define USED_IF_NOT_THREADS
#endif
/* -----------------------------------------------------------------------------
Include everything STG-ish
-------------------------------------------------------------------------- */
......
/* ---------------------------------------------------------------------------
*
* (c) The GHC Team, 2003-2005
* (c) The GHC Team, 2003-2006
*
* Capabilities
*
......@@ -39,29 +39,15 @@ Capability *capabilities = NULL;
// locking, so we don't do that.
Capability *last_free_capability;
#ifdef SMP
#define UNUSED_IF_NOT_SMP
#else
#define UNUSED_IF_NOT_SMP STG_UNUSED
#endif
#ifdef RTS_USER_SIGNALS
#define UNUSED_IF_NOT_THREADS
#else
#define UNUSED_IF_NOT_THREADS STG_UNUSED
#endif
#if defined(THREADED_RTS)
STATIC_INLINE rtsBool
globalWorkToDo (void)
{
return blackholes_need_checking
|| interrupted
#if defined(RTS_USER_SIGNALS)
|| signals_pending()
#endif
;
}
#endif
#if defined(THREADED_RTS)
STATIC_INLINE rtsBool
......@@ -213,7 +199,7 @@ initCapabilities( void )
#if defined(THREADED_RTS)
STATIC_INLINE void
giveCapabilityToTask (Capability *cap, Task *task)
giveCapabilityToTask (Capability *cap USED_IF_DEBUG, Task *task)
{
ASSERT_LOCK_HELD(&cap->lock);
ASSERT(task->cap == cap);
......@@ -295,7 +281,7 @@ releaseCapability_ (Capability* cap)
}
void
releaseCapability (Capability* cap UNUSED_IF_NOT_THREADS)
releaseCapability (Capability* cap USED_IF_THREADS)
{
ACQUIRE_LOCK(&cap->lock);
releaseCapability_(cap);
......@@ -303,7 +289,7 @@ releaseCapability (Capability* cap UNUSED_IF_NOT_THREADS)
}
static void
releaseCapabilityAndQueueWorker (Capability* cap UNUSED_IF_NOT_THREADS)
releaseCapabilityAndQueueWorker (Capability* cap USED_IF_THREADS)
{
Task *task;
......@@ -341,8 +327,7 @@ releaseCapabilityAndQueueWorker (Capability* cap UNUSED_IF_NOT_THREADS)
*
* ------------------------------------------------------------------------- */
void
waitForReturnCapability (Capability **pCap,
Task *task UNUSED_IF_NOT_THREADS)
waitForReturnCapability (Capability **pCap, Task *task)
{
#if !defined(THREADED_RTS)
......
......@@ -72,20 +72,6 @@
# define STATIC_INLINE static
#endif
#ifdef THREADED_RTS
#define USED_WHEN_THREADED_RTS
#define USED_WHEN_NON_THREADED_RTS STG_UNUSED
#else
#define USED_WHEN_THREADED_RTS STG_UNUSED
#define USED_WHEN_NON_THREADED_RTS
#endif
#ifdef SMP
#define USED_WHEN_SMP
#else
#define USED_WHEN_SMP STG_UNUSED
#endif
/* -----------------------------------------------------------------------------
* Global variables
* -------------------------------------------------------------------------- */
......@@ -730,8 +716,8 @@ schedulePreLoop(void)
#ifdef SMP
static void
schedulePushWork(Capability *cap USED_WHEN_SMP,
Task *task USED_WHEN_SMP)
schedulePushWork(Capability *cap USED_IF_SMP,
Task *task USED_IF_SMP)
{
Capability *free_caps[n_capabilities], *cap0;
nat i, n_free_caps;
......@@ -854,7 +840,7 @@ scheduleStartSignalHandlers(Capability *cap STG_UNUSED)
* ------------------------------------------------------------------------- */
static void
scheduleCheckBlockedThreads(Capability *cap USED_WHEN_NON_THREADED_RTS)
scheduleCheckBlockedThreads(Capability *cap USED_IF_NOT_THREADS)
{
#if !defined(THREADED_RTS)
//
......@@ -1882,7 +1868,7 @@ scheduleDoHeapProfile( rtsBool ready_to_gc STG_UNUSED )
* -------------------------------------------------------------------------- */
static void
scheduleDoGC( Capability *cap, Task *task USED_WHEN_SMP, rtsBool force_major )
scheduleDoGC( Capability *cap, Task *task USED_IF_SMP, rtsBool force_major )
{
StgTSO *t;
#ifdef SMP
......@@ -2022,7 +2008,7 @@ rtsSupportsBoundThreads(void)
* ------------------------------------------------------------------------- */
StgBool
isThreadBound(StgTSO* tso USED_WHEN_THREADED_RTS)
isThreadBound(StgTSO* tso USED_IF_THREADS)
{
#if defined(THREADED_RTS)
return (tso->bound != NULL);
......
......@@ -18,7 +18,6 @@ extern StgPtr *next_pending_handler;
#define signals_pending() (next_pending_handler != pending_handler_buf)
void startSignalHandlers(Capability *cap);
#endif
extern StgInt *signal_handlers;
......
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