projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
also call initMutex on every task->lock, see #1391
[ghc-hetmet.git]
/
rts
/
Schedule.c
diff --git
a/rts/Schedule.c
b/rts/Schedule.c
index
22e6120
..
375520d
100644
(file)
--- a/
rts/Schedule.c
+++ b/
rts/Schedule.c
@@
-2143,6
+2143,7
@@
forkProcess(HsStablePtr *entry
// inconsistent state in the child. See also #1391.
ACQUIRE_LOCK(&sched_mutex);
ACQUIRE_LOCK(&cap->lock);
// inconsistent state in the child. See also #1391.
ACQUIRE_LOCK(&sched_mutex);
ACQUIRE_LOCK(&cap->lock);
+ ACQUIRE_LOCK(&cap->running_task->lock);
pid = fork();
pid = fork();
@@
-2150,6
+2151,7
@@
forkProcess(HsStablePtr *entry
RELEASE_LOCK(&sched_mutex);
RELEASE_LOCK(&cap->lock);
RELEASE_LOCK(&sched_mutex);
RELEASE_LOCK(&cap->lock);
+ RELEASE_LOCK(&cap->running_task->lock);
// just return the pid
rts_unlock(cap);
// just return the pid
rts_unlock(cap);
@@
-2160,6
+2162,7
@@
forkProcess(HsStablePtr *entry
#if defined(THREADED_RTS)
initMutex(&sched_mutex);
initMutex(&cap->lock);
#if defined(THREADED_RTS)
initMutex(&sched_mutex);
initMutex(&cap->lock);
+ initMutex(&cap->running_task->lock);
#endif
// Now, all OS threads except the thread that forked are
#endif
// Now, all OS threads except the thread that forked are
@@
-2199,6
+2202,9
@@
forkProcess(HsStablePtr *entry
ACQUIRE_LOCK(&sched_mutex);
for (task = all_tasks; task != NULL; task=task->all_link) {
if (task != cap->running_task) {
ACQUIRE_LOCK(&sched_mutex);
for (task = all_tasks; task != NULL; task=task->all_link) {
if (task != cap->running_task) {
+#if defined(THREADED_RTS)
+ initMutex(&task->lock); // see #1391
+#endif
discardTask(task);
}
}
discardTask(task);
}
}