File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,15 @@ let wakeup t =
7373 Rcfd. use t.eventfd
7474 ~if_closed: ignore (* Domain has shut down (presumably after handling the event) *)
7575 (fun fd ->
76- (* This can fail if the pipe is full, but then a wake up is pending anyway. *)
77- ignore (Unix. single_write fd wake_buffer 0 1 : int );
76+ try
77+ ignore (Unix. single_write fd wake_buffer 0 1 : int )
78+ with
79+ | Unix. Unix_error ((Unix. EAGAIN | EWOULDBLOCK ), _ , _ ) ->
80+ (* If the pipe is full then a wake up is pending anyway. *)
81+ ()
82+ | Unix. Unix_error (Unix. EPIPE, _ , _ ) ->
83+ (* We're shutting down; the event has already been processed. *)
84+ ()
7885 )
7986
8087(* Safe to call from anywhere (other systhreads, domains, signal handlers, GC finalizers) *)
You can’t perform that action at this time.
0 commit comments