]> pd.if.org Git - nbds/blobdiff - include/txn.h
Warning tests are failing in this version
[nbds] / include / txn.h
index c23c59b8548085e8f09aa4b07d1bd428896be634..34a385758271dc1f8d6fd28ae784913f3ca153d2 100644 (file)
@@ -4,12 +4,20 @@
  */
 #ifndef TXN_H
 #define TXN_H
+
 #include "map.h"
 
-typedef enum { TXN_READ_WRITE, TXN_READ_ONLY, TXN_BLIND_WRITE } txn_access_t;
-typedef enum { TXN_DIRTY_READ, TXN_READ_COMMITTED, TXN_REPEATABLE_READ } txn_isolation_t;
+typedef enum { TXN_RUNNING, TXN_VALIDATING, TXN_VALIDATED, TXN_ABORTED } txn_state_e;
 
 typedef struct txn txn_t;
 
-txn_t *txn_begin (txn_access_t access, txn_isolation_t isolation, map_t *map);
+void txn_init (void);
+
+txn_t *     txn_begin  (map_t *map);
+void        txn_abort  (txn_t *txn);
+txn_state_e txn_commit (txn_t *txn);
+
+uint64_t    txn_map_get (txn_t *txn, map_key_t key);
+void        txn_map_set (txn_t *txn, map_key_t key, map_val_t value);
+
 #endif//TXN_H