1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-29 01:40:26 +00:00

Throw error on bad thread creation.

This commit is contained in:
Calvin Rose 2019-12-18 15:49:57 -05:00
parent 6a39c4b91d
commit 07b0ef1648

View File

@ -551,7 +551,9 @@ static Janet cfun_thread_new(int32_t argc, Janet *argv) {
} }
/* If thread started, send the worker function. */ /* 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); return janet_wrap_abstract(thread);
} }