summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-07 11:45:21 -0500
committerBen Gamari <ben@smart-cactus.org>2019-11-07 11:45:21 -0500
commit8ec8b8941d7d90d50aab2f067253804d043108c4 (patch)
treee2ef539f8c1f0eee77423e569ed41c96f2a4bbad
parent387e86d2ab99e3b354f101d213aa8397633865c8 (diff)
downloadhaskell-8ec8b8941d7d90d50aab2f067253804d043108c4.tar.gz
rts/nonmoving: Catch failure of createOSThread
-rw-r--r--rts/sm/NonMoving.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c
index 50cf784aab..20ec5a45ba 100644
--- a/rts/sm/NonMoving.c
+++ b/rts/sm/NonMoving.c
@@ -896,8 +896,10 @@ void nonmovingCollect(StgWeak **dead_weaks, StgTSO **resurrected_threads)
concurrent_coll_running = true;
nonmoving_write_barrier_enabled = true;
debugTrace(DEBUG_nonmoving_gc, "Starting concurrent mark thread");
- createOSThread(&mark_thread, "non-moving mark thread",
- nonmovingConcurrentMark, mark_queue);
+ if (createOSThread(&mark_thread, "non-moving mark thread",
+ nonmovingConcurrentMark, mark_queue) != 0) {
+ barf("nonmovingCollect: failed to spawn mark thread: %s", strerror(errno));
+ }
} else {
nonmovingConcurrentMark(mark_queue);
}