IK
Size: a a a
AP
AP
AP
MP
withROTransaction :: ModeBool eпервое что приходит в голову — есть небольшой шанс что mdb_txn_abort будет вызвана после/во время mdb_txn_commit
=> Environment e
-> (Transaction ReadOnly -> IO a)
-> IO a
withROTransaction e@(Environment env) f =
bracketOnError
(mdb_txn_begin env Nothing True)
mdb_txn_abort
$ \txn -> do
a <- f (Transaction txn)
mdb_txn_commit txn
return a
MP
MP
MP
\txn -> do
!a <- f (Transaction txn)
mdb_txn_commit txn
return a
YS
\txn -> do
!a <- f (Transaction txn)
mdb_txn_commit txn
return a
MP
MP
YS
unsafeInterleaveIO
?YS
MP
MP
YS
unsafeInterleaveIO allows an IO computation to be deferred lazily. When passed a value of type IO a, the IO will only be performed when the value of the a is demanded. This is used to implement lazy file reading, see hGetContents.
YS
f
MP
YS