Mercurial > repos > rhope
changeset 138:1411de6050e1
First stab at transaction data structures, needs work
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 16 Nov 2010 21:53:18 -0500 |
parents | daf1ffaf7c2c |
children | a68e6828d896 |
files | runtime/transaction.h |
diffstat | 1 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtime/transaction.h Tue Nov 16 21:53:18 2010 -0500 @@ -0,0 +1,30 @@ +#ifndef THREAD_H_ +#define THREAD_H_ + +#include "object.h" + +typedef struct +{ + object header; + object * data; + int32_t version; +} mutable_object; + +typedef struct +{ + mutable_object *obj; + object **commit_loc; + int32_t orig_version; + int32_t local_version; +} trans_cell; + + +typedef struct transaction +{ + struct transaction *parent; + rh_mutex(lock) + int32_t num_cells; + trans_cell[1] cells; +} transaction; + +#endif //THREAD_H_