mirror of
https://github.com/janet-lang/janet
synced 2025-11-02 16:43:02 +00:00
Throw error on bad thread creation.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user