Commit 3d1e773e authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Use Lwt_mutex.with_lock

parent d647e625
...@@ -419,11 +419,10 @@ let get_randomness = ...@@ -419,11 +419,10 @@ let get_randomness =
)) in )) in
let mutex = Lwt_mutex.create () in let mutex = Lwt_mutex.create () in
fun () -> fun () ->
Lwt_mutex.lock mutex >> Lwt_mutex.with_lock mutex (fun () ->
lwt prng = Lazy.force prng in lwt prng = Lazy.force prng in
let r = Cryptokit.Random.(string prng 32) in return Cryptokit.Random.(string prng 32)
Lwt_mutex.unlock mutex; )
return r
let () = Eliom_registration.String.register let () = Eliom_registration.String.register
~service:Services.get_randomness ~service:Services.get_randomness
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment