Skip to content

Commit

Permalink
Avoid mutex change of ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier R. Guérin committed Oct 21, 2020
1 parent e06a250 commit bc8615c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lsp/src/scheduler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ let time_loop t =
add_events t !to_run;
loop ()
in
loop ()
with_mutex t.time_mutex ~f:loop

let wake_loop t =
let rec loop () =
Expand Down Expand Up @@ -253,7 +253,6 @@ let create () =
; detached = Queue.create ()
}
in
Mutex.lock t.time_mutex;
t.time <- Thread.create time_loop t;
t.waker <- Thread.create wake_loop t;
t
Expand Down

0 comments on commit bc8615c

Please sign in to comment.