Module Luv__.Thread
type t
Binds
uv_thread_t
.
val self : unit -> t
Returns the representation of the calling thread.
Binds
uv_thread_self
. Seepthread_self(3p)
.
val equal : t -> t -> bool
Compares two thread values for equality.
Binds
uv_thread_equal
. Seepthread_equal(3p)
.
val create : ?stack_size:int -> (unit -> unit) -> (t, Luv.Error.t) Result.result
Starts a new thread, which will run the given function.
Binds
uv_thread_create
. Seepthread_create(3p)
.?stack_size
does nothing on libuv prior to 1.26.0.Feature check:
Luv.Require.(has thread_stack_size)
val create_c : ?stack_size:int -> ?argument:nativeint -> nativeint -> (t, Luv.Error.t) Result.result
Like
Luv.Thread.create
, but runs a C function by pointer.The C function should have signature
(*)(void*)
. The default value of?argument
isNULL
(0).?stack_size
does nothing on libuv prior to 1.26.0.Feature check:
Luv.Require.(has thread_stack_size)
val join : t -> (unit, Luv.Error.t) Result.result
Waits for the given thread to terminate.
Binds
uv_thread_join
. Seepthread_join(3p)
.