Module thread

Module thread 

Source
Available on crate feature thread only.
Expand description

Thread spawning, joining, and detaching.

Structs§

NSTDThread
Represents a running thread.
NSTDThreadDescriptor
Describes the creation of a new thread.
NSTDThreadHandle
A handle to a running thread.
NSTDThreadID
A thread’s unique identifier.

Functions§

nstd_thread_count
Returns the number of recommended threads that a program should use.
nstd_thread_current
Returns a handle to the calling thread.
nstd_thread_detach
Detaches a thread from it’s handle, allowing it to run in the background.
nstd_thread_handle
Retrieves a raw handle to a thread.
nstd_thread_handle_free
Frees an instance of NSTDThreadHandle.
nstd_thread_id
Returns a thread’s unique identifier.
nstd_thread_id_compare
Compares two thread identifiers.
nstd_thread_id_free
Frees an instance of NSTDThreadID.
nstd_thread_is_finished
Checks if a thread has finished running.
nstd_thread_is_panicking
Checks if the current thread is unwinding due to a panic.
nstd_thread_join
Joins a thread by it’s handle.
nstd_thread_name
Returns the name of a thread.
nstd_thread_sleep
Puts the current thread to sleep for a specified duration.
nstd_thread_spawn
Spawns a new thread executing the function thread_fn and returns a handle to the new thread.

Type Aliases§

NSTDOptionalThread
Represents an optional value of type NSTDThread.
NSTDOptionalThreadResult
Returned from nstd_thread_join, contains the thread function’s return value on success.
NSTDThreadCountResult
Returned from nstd_thread_count, contains the number of threads detected on the system on success.
NSTDThreadResult
A thread function’s return value.