From 07b0ef16482e16d5a84cb2651cbd1ea56251b307 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Wed, 18 Dec 2019 15:49:57 -0500 Subject: [PATCH] Throw error on bad thread creation. --- src/core/thread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/thread.c b/src/core/thread.c index 23c9a8eb..0010d4e0 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -551,7 +551,9 @@ static Janet cfun_thread_new(int32_t argc, Janet *argv) { } /* If thread started, send the worker function. */ - janet_thread_send(thread, argv[0], -1.0); + if (janet_thread_send(thread, argv[0], -1.0)) { + janet_panicf("could not send worker function %v to thread", argv[0]); + } return janet_wrap_abstract(thread); }