1. Dmitry Grebeniuk
  2. parvel

Commits

Dmitry Grebeniuk  committed 694693e

Lwt_mvar_parvel: + have_any_reader

  • Participants
  • Parent commits bdfd547
  • Branches default

Comments (0)

Files changed (2)

File lwt_mvar_parvel.ml

View file
 
 let will_put_block mvar =
   mvar.contents <> None
+
+let have_any_reader mvar =
+  not (Lwt_sequence.is_empty mvar.readers)

File lwt_mvar_parvel.mli

View file
 val will_put_block : 'a t -> bool
   (** [will_put_block mvar] returns true if next [put mvar] will block
       the current thread *)
+
+val have_any_reader : 'a t -> bool
+  (** [have_any_reader mvar] returns true if there exists any
+      thread waiting for the [mvar] *)