1
type waiter =
    { w_wait : unit Lwt.t;
      w_waker: unit Lwt.u option;
      mutable w_did_wait : bool }

I don't understand why there are "unit" in w_wait and w_waker?

nlucaroni
  • 47,556
  • 6
  • 64
  • 86
z_axis
  • 8,272
  • 7
  • 41
  • 61

1 Answers1

4

According to Lwt's doc the type 'a Lwt.t is the "type of threads returning a result of type 'a.", so your w_wait is a cooperative thread returning unit (i.e. having only side effects). Likewise 'a Lwt.u is the "type of thread wakeners".

I don't understand what you don't understand in Lwt documentation. It seems quite understandable to me.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547