sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Postgresql.ConnectionSourceConnection parametrized by the type of mutex used.
If you are using your own wrapper around connection, you could for instance use this kind of code:
module Check = struct
type t = bool Atomic.t
let create () = Atomic.make false
let lock m =
if not (Atomic.compare_and_set m false true) then
failwith "Concurrent use of a Postgres connection (at lock)"
let unlock m =
if not (Atomic.compare_and_set m true false) then
failwith
"Concurrent use of a Postgres connection (at unlock, impossible \
?)"
end
module Postgresql = struct
include Postgresql
include Connection (Check)
endclass connection : ?host:string -> ?hostaddr:string -> ?port:string -> ?dbname:string -> ?user:
string -> ?password:string -> ?options:string -> ?tty:string -> ?requiressl:
string -> ?conninfo:string -> ?startonly:bool -> unit -> connection_class