projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make the dynamic linker thread-safe.
[ghc-hetmet.git]
/
rts
/
Schedule.c
diff --git
a/rts/Schedule.c
b/rts/Schedule.c
index
c840c78
..
dd33f6f
100644
(file)
--- a/
rts/Schedule.c
+++ b/
rts/Schedule.c
@@
-9,34
+9,25
@@
#include "PosixSource.h"
#define KEEP_LOCKCLOSURE
#include "Rts.h"
#include "PosixSource.h"
#define KEEP_LOCKCLOSURE
#include "Rts.h"
-#include "SchedAPI.h"
+
+#include "sm/Storage.h"
#include "RtsUtils.h"
#include "RtsUtils.h"
-#include "RtsFlags.h"
-#include "OSThreads.h"
-#include "Storage.h"
#include "StgRun.h"
#include "StgRun.h"
-#include "Hooks.h"
#include "Schedule.h"
#include "Schedule.h"
-#include "StgMiscClosures.h"
#include "Interpreter.h"
#include "Printer.h"
#include "RtsSignals.h"
#include "Sanity.h"
#include "Stats.h"
#include "STM.h"
#include "Interpreter.h"
#include "Printer.h"
#include "RtsSignals.h"
#include "Sanity.h"
#include "Stats.h"
#include "STM.h"
-#include "Timer.h"
#include "Prelude.h"
#include "ThreadLabels.h"
#include "Prelude.h"
#include "ThreadLabels.h"
-#include "LdvProfile.h"
#include "Updates.h"
#include "Proftimer.h"
#include "ProfHeap.h"
#include "Updates.h"
#include "Proftimer.h"
#include "ProfHeap.h"
-#include "GC.h"
#include "Weak.h"
#include "Weak.h"
-#include "EventLog.h"
-
-/* PARALLEL_HASKELL includes go here */
-
+#include "eventlog/EventLog.h"
+#include "sm/GC.h" // waitForGcThreads, releaseGCThreads, N
#include "Sparks.h"
#include "Capability.h"
#include "Task.h"
#include "Sparks.h"
#include "Capability.h"
#include "Task.h"
@@
-47,7
+38,8
@@
#include "Trace.h"
#include "RaiseAsync.h"
#include "Threads.h"
#include "Trace.h"
#include "RaiseAsync.h"
#include "Threads.h"
-#include "ThrIOManager.h"
+#include "Timer.h"
+#include "ThreadPaused.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@
-64,12
+56,6
@@
#include <errno.h>
#endif
#include <errno.h>
#endif
-// Turn off inlining when debugging - it obfuscates things
-#ifdef DEBUG
-# undef STATIC_INLINE
-# define STATIC_INLINE static
-#endif
-
/* -----------------------------------------------------------------------------
* Global variables
* -------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Global variables
* -------------------------------------------------------------------------- */
@@
-188,12
+174,12
@@
static void deleteThread_(Capability *cap, StgTSO *tso);
#ifdef DEBUG
static char *whatNext_strs[] = {
#ifdef DEBUG
static char *whatNext_strs[] = {
- "(unknown)",
- "ThreadRunGHC",
- "ThreadInterpret",
- "ThreadKilled",
- "ThreadRelocated",
- "ThreadComplete"
+ [0] = "(unknown)",
+ [ThreadRunGHC] = "ThreadRunGHC",
+ [ThreadInterpret] = "ThreadInterpret",
+ [ThreadKilled] = "ThreadKilled",
+ [ThreadRelocated] = "ThreadRelocated",
+ [ThreadComplete] = "ThreadComplete"
};
#endif
};
#endif
@@
-1731,7
+1717,6
@@
forkProcess(HsStablePtr *entry
}
#else /* !FORKPROCESS_PRIMOP_SUPPORTED */
barf("forkProcess#: primop not supported on this platform, sorry!\n");
}
#else /* !FORKPROCESS_PRIMOP_SUPPORTED */
barf("forkProcess#: primop not supported on this platform, sorry!\n");
- return -1;
#endif
}
#endif
}
@@
-2383,7
+2368,9
@@
interruptStgRts(void)
{
sched_state = SCHED_INTERRUPTING;
setContextSwitches();
{
sched_state = SCHED_INTERRUPTING;
setContextSwitches();
+#if defined(THREADED_RTS)
wakeUpRts();
wakeUpRts();
+#endif
}
/* -----------------------------------------------------------------------------
}
/* -----------------------------------------------------------------------------
@@
-2399,16
+2386,15
@@
interruptStgRts(void)
will have interrupted any blocking system call in progress anyway.
-------------------------------------------------------------------------- */
will have interrupted any blocking system call in progress anyway.
-------------------------------------------------------------------------- */
-void
-wakeUpRts(void)
-{
#if defined(THREADED_RTS)
#if defined(THREADED_RTS)
+void wakeUpRts(void)
+{
// This forces the IO Manager thread to wakeup, which will
// in turn ensure that some OS thread wakes up and runs the
// scheduler loop, which will cause a GC and deadlock check.
ioManagerWakeup();
// This forces the IO Manager thread to wakeup, which will
// in turn ensure that some OS thread wakes up and runs the
// scheduler loop, which will cause a GC and deadlock check.
ioManagerWakeup();
-#endif
}
}
+#endif
/* -----------------------------------------------------------------------------
* checkBlackHoles()
/* -----------------------------------------------------------------------------
* checkBlackHoles()