diff options
author | gareuselesinge <gareuselesinge@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-08-30 12:20:10 +0000 |
---|---|---|
committer | gareuselesinge <gareuselesinge@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-08-30 12:20:10 +0000 |
commit | 6a5b186d2b53cf2c3e3a7ed5c238d26367a9df96 (patch) | |
tree | 06830f8dd95df021b1c84e97801e4b49b585f3eb /lib/future.ml | |
parent | fe07a7f5f4b5b1d92e0e83cab9b886b642c6f8eb (diff) |
recdef: restore old semantics (pre STM)
The Stm commit switched from an home made handling of failures to
a with_state_protection. This was wrong, since in case of success
the global state has to be left altered.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16746 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/future.ml')
-rw-r--r-- | lib/future.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/future.ml b/lib/future.ml index 1e9cada51..d8f7b3a94 100644 --- a/lib/future.ml +++ b/lib/future.ml @@ -111,6 +111,11 @@ let purify f x = v with e -> let e = Errors.push e in !unfreeze state; raise e +let transactify f x = + let state = !freeze () in + try f x + with e -> let e = Errors.push e in !unfreeze state; raise e + let purify_future f x = match !x with | Val _ | Exn _ | Delegated | Dropped -> f x |