Janet 1.10.1-9cfc3d9 Documentation
(thread/close thread) Close a thread, unblocking it and ending communication with it. Note that closing a thread is idempotent and does not cancel the thread's operation. Returns nil.
(thread/current) Get the current running thread.
(thread/new func &opt capacity flags) Start a new thread that will start immediately. If capacity is provided, that is how many messages can be stored in the thread's mailbox before blocking senders. The capacity must be between 1 and 65535 inclusive, and defaults to 10. Can optionally provide flags to the new thread - supported flags are: :h - Start a heavyweight thread. This loads the core environment by default, so may use more memory initially. Messages may compress better, though. :a - Allow sending over registered abstract types to the new thread :c - Send over cfunction information to the new thread. Returns a handle to the new thread.
(thread/receive &opt timeout) Get a message sent to this thread. If timeout is provided, an error will be thrown after the timeout has elapsed but no messages are received.
(thread/send thread msg) Send a message to the thread. This will never block and returns thread immediately. Will throw an error if there is a problem sending the message.