@@ -38,23 +38,31 @@ libdtm api
38
38
39
39
void DtmInitSnapshot(Snapshot snapshot);
40
40
41
- // Starts new global transaction
42
- TransactionId DtmGlobalStartTransaction(int nParticipants, Snapshot shaposhot);
41
+ // Starts a new global transaction of nParticipants size. Returns the
42
+ // transaction id and fills the snapshot on success. Returns INVALID_XID
43
+ // otherwise.
44
+ TransactionId DtmGlobalStartTransaction(int nParticipants, Snapshot shapshot);
43
45
44
- // Get existed DTM snapshot.
46
+ // Asks the DTM for a fresh snapshot.
45
47
void DtmGlobalGetSnapshot(TransactionId xid, Snapshot snapshot);
46
48
47
49
// Commits transaction only once all participants have called this function,
48
- // does not change CLOG otherwise.
49
- void DtmGlobalSetTransStatus(TransactionId xid, XidStatus status, bool wait);
50
+ // does not change CLOG otherwise. Set 'wait' to 'true' if you want this call
51
+ // to return only after the transaction is considered finished by the DTM.
52
+ // Returns the status on success, or -1 otherwise.
53
+ XidStatus DtmGlobalSetTransStatus(TransactionId xid, XidStatus status, bool wait);
50
54
51
55
// Gets the status of the transaction identified by 'xid'. Returns the status
52
56
// on success, or -1 otherwise. If 'wait' is true, then it does not return
53
57
// until the transaction is finished.
54
58
XidStatus DtmGlobalGetTransStatus(TransactionId xid, bool wait);
55
59
56
- // Reserve XIDs for local transaction
57
- TransactioinId DtmGlobalReserve(int nXids);
60
+ // Reserves at least 'nXids' successive xids for local transactions. The xids
61
+ // reserved are not less than 'xid' in value. Returns the actual number
62
+ // of xids reserved, and sets the 'first' xid accordingly. The number of xids
63
+ // reserved is guaranteed to be at least nXids.
64
+ // In other words, *first ≥ xid and result ≥ nXids.
65
+ int DtmGlobalReserve(TransactionId xid, int nXids, TransactionId *first);
58
66
59
67
--------------------
60
68
Backend-DTM Protocol
0 commit comments