`thread`: `luv_thread_t userdata`
Gets the thread's priority setting.
Retrieves the scheduling priority of the specified thread. The
returned priority value is platform dependent.
For Linux, when schedule policy is SCHED_OTHER (default),
priority is 0.
Returns: `number` or `fail`
uv.thread_self() *uv.thread_self()*
Returns the handle for the thread in which this is called.
Returns: `luv_thread_t`
uv.thread_join({thread}) *uv.thread_join()*
> method form `thread:join()`
Parameters:
- `thread`: `luv_thread_t userdata`
Waits for the `thread` to finish executing its entry function.
Returns: `boolean` or `fail`
uv.thread_detach({thread}) *uv.thread_detach()*
> method form `thread:detach()`
Parameters:
- `thread`: `luv_thread_t userdata`
Detaches a thread. Detached threads automatically release
their resources upon termination, eliminating the need for the
application to call `uv.thread_join`.
Returns: `boolean` or `fail`
uv.thread_setname({name}) *uv.thread_setname()*
Parameters:
- `name`: `string`
Sets the name of the current thread. Different platforms
define different limits on the max number of characters a
thread name can be: Linux, IBM i (16), macOS (64), Windows
(32767), and NetBSD (32), etc. The name will be truncated if
`name` is larger than the limit of the platform.
Returns: `0` or `fail`
uv.thread_getname({thread}) *uv.thread_getname()*
> method form `thread:getname()`
Parameters:
- `thread`: `luv_thread_t userdata`
Gets the name of the thread specified by `thread`.
Returns: `string` or `fail`
uv.sleep({msec}) *uv.sleep()*
Parameters:
- `msec`: `integer`
Pauses the thread in which this is called for a number of
milliseconds.
Returns: Nothing.
uv.new_sem([{value}]) *uv.new_sem()*
Parameters:
- `value`: `integer` or `nil`
Creates a new semaphore with the specified initial value. A
semaphore is safe to share across threads. It represents an
unsigned integer value that can incremented and decremented
atomically but any attempt to make it negative will "wait"
until the value can be decremented by another thread
incrementing it.
The initial value must be a non-negative integer.
Returns: `luv_sem_t userdata` or `fail`
Note: A semaphore must be shared between threads, any
`uv.sem_wait()` on a single thread that blocks will deadlock.
uv.sem_post({sem}) *uv.sem_post()*
> method form `sem:post()`
Parameters:
- `sem`: `luv_sem_t userdata`
Increments (unlocks) a semaphore, if the semaphore's value
consequently becomes greater than zero then another thread
blocked in a sem_wait call will be woken and proceed to
decrement the semaphore.
Returns: Nothing.
uv.sem_wait({sem}) *uv.sem_wait()*
> method form `sem:wait()`