Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/library/transaction.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/library/transaction.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 411 - (view) (download)
Original Path: sml/branches/SMLNJ/src/MLRISC/library/transaction.sml

1 : monnier 411 (*
2 :     * This starts a transaction
3 :     *
4 :     * -- Allen
5 :     *)
6 :    
7 : monnier 245 functor TransactionFn(Log : TRANSACTION_LOG) : TRANSACTION =
8 :     struct
9 :    
10 :     exception Abort
11 :    
12 :     fun transaction default func =
13 :     let
14 :     val _ = Log.begin()
15 :     val x = func()
16 :     val _ = Log.commit()
17 :     in
18 :     x
19 :     end
20 :     handle Abort => (Log.abort(); default)
21 :     | e => (Log.abort(); raise e)
22 :    
23 :     end
24 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0