summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-07 11:45:21 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-08 12:10:01 -0500
commit6e4656cc95ad504a42080bcaf8afc80fec7be2d6 (patch)
treed49c7df31ee85e2962dcf6b47d3fa022d973674e
parent43623b0980cd5c72686f9480e7de14f886b851ad (diff)
downloadhaskell-6e4656cc95ad504a42080bcaf8afc80fec7be2d6.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);
}