mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-13 05:02:50 -06:00
transactions should always start with the last revision and release it when done
This commit is contained in:
@@ -175,7 +175,7 @@ foreign import ccall pgf_infer_expr :: Ptr PgfDB -> Ptr PGF -> Ptr (StablePtr Ex
|
||||
|
||||
foreign import ccall pgf_check_type :: Ptr PgfDB -> Ptr PGF -> Ptr (StablePtr Type) -> Ptr PgfMarshaller -> Ptr PgfUnmarshaller -> Ptr PgfExn -> IO ()
|
||||
|
||||
foreign import ccall pgf_start_transaction :: Ptr PgfDB -> Ptr PGF -> Ptr PgfExn -> IO (Ptr PGF)
|
||||
foreign import ccall pgf_start_transaction :: Ptr PgfDB -> Ptr PgfExn -> IO (Ptr PGF)
|
||||
|
||||
foreign import ccall pgf_commit_transaction :: Ptr PgfDB -> Ptr PGF -> Ptr PgfExn -> IO ()
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ modifyPGF p (Transaction f) =
|
||||
withForeignPtr (a_revision p) $ \c_revision ->
|
||||
withPgfExn "modifyPGF" $ \c_exn ->
|
||||
mask $ \restore -> do
|
||||
c_revision <- pgf_start_transaction (a_db p) c_revision c_exn
|
||||
c_revision <- pgf_start_transaction (a_db p) c_exn
|
||||
ex_type <- (#peek PgfExn, type) c_exn
|
||||
if (ex_type :: (#type PgfExnType)) == (#const PGF_EXN_NONE)
|
||||
then do ((restore (f (a_db p) c_revision c_revision c_exn))
|
||||
|
||||
Reference in New Issue
Block a user