1234567891011121314externalunlock:Mutex.t->unit="caml_mutex_unlock"(* Critical sections :
- Mutex.lock does not poll on leaving the blocking section
since 4.12.
- Never inline, to avoid theoretically-possible reorderings with
flambda.
- Inline the call to Mutex.unlock to avoid polling in bytecode.
(workaround to the lack of masking) *)let[@inlinenever]with_lockm~scope=let()=Mutex.lockm(* BEGIN ATOMIC *)inmatch(* END ATOMIC *)scope()with|(* BEGIN ATOMIC *)x->unlockm;(* END ATOMIC *)x|(* BEGIN ATOMIC *)exceptione->unlockm;(* END ATOMIC *)raisee