mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
add Pool.size
This commit is contained in:
parent
1f31f26edf
commit
6ffbd15a34
3 changed files with 5 additions and 1 deletions
|
|
@ -11,8 +11,8 @@ depends: [
|
||||||
"ocaml" {>= "4.08"}
|
"ocaml" {>= "4.08"}
|
||||||
"dune" {>= "3.0"}
|
"dune" {>= "3.0"}
|
||||||
"either"
|
"either"
|
||||||
"mdx" {>= "1.9.0" & with-test}
|
|
||||||
"odoc" {with-doc}
|
"odoc" {with-doc}
|
||||||
|
"mdx" {>= "1.9.0" & with-test}
|
||||||
]
|
]
|
||||||
build: [
|
build: [
|
||||||
["dune" "subst"] {dev}
|
["dune" "subst"] {dev}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ let add_global_thread_loop_wrapper f : unit =
|
||||||
done
|
done
|
||||||
|
|
||||||
let[@inline] run self f : unit = S_queue.push self.q f
|
let[@inline] run self f : unit = S_queue.push self.q f
|
||||||
|
let size self = Array.length self.threads
|
||||||
|
|
||||||
let worker_thread_ ~on_exn (active : bool A.t) (q : _ S_queue.t) : unit =
|
let worker_thread_ ~on_exn (active : bool A.t) (q : _ S_queue.t) : unit =
|
||||||
while A.get active do
|
while A.get active do
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ val create :
|
||||||
to use for this pool's workers.
|
to use for this pool's workers.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
val size : t -> int
|
||||||
|
(** Number of threads *)
|
||||||
|
|
||||||
val shutdown : t -> unit
|
val shutdown : t -> unit
|
||||||
(** Shutdown the pool and wait for it to terminate. Idempotent. *)
|
(** Shutdown the pool and wait for it to terminate. Idempotent. *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue