tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
stm.h
Go to the documentation of this file.
1 /******************************************************************************
2  * stm.h
3  *
4  * Interface definitions for software transactional memory (STM).
5  *
6  * Copyright (c) 2002-2003, K A Fraser
7  */
8 
9 #include "ptst.h"
10 #include <setjmp.h>
11 
12 typedef struct stm_st stm;
13 typedef struct stm_blk_st stm_blk;
14 typedef struct stm_tx_st stm_tx;
15 
17 void free_stm(ptst_t *ptst, stm *mem);
18 
20 void free_stm_blk(ptst_t *ptst, stm *mem, stm_blk *b);
21 void *init_stm_blk(ptst_t *ptst, stm *mem, stm_blk *b);
22 int sizeof_stm_blk(ptst_t *ptst, stm *mem, stm_blk *b);
23 
24 stm_tx *new_stm_tx(ptst_t *ptst, stm *mem, sigjmp_buf *penv);
27 /* NB. Must still call commit after abort, but it's guaranteed to fail. */
28 void abort_stm_tx(ptst_t *ptst, stm_tx *t);
29 
30 void *read_stm_blk(ptst_t *ptst, stm_tx *t, stm_blk *b);
31 void *write_stm_blk(ptst_t *ptst, stm_tx *t, stm_blk *b);
32 
33 void remove_from_tx(ptst_t *ptst, stm_tx *t, stm_blk *b);
34 
35 void _init_stm_subsystem(int pad_data);
36 
37 #define new_stm_tx(_tx, _ptst, _mem) \
38  do { \
39  sigjmp_buf env; \
40  sigsetjmp(env, 1); \
41  (_tx) = new_stm_tx((_ptst), (_mem), &env); \
42  } while ( 0 )
sigjmp_buf * penv
Definition: stm_fraser.c:58
Definition: ptst.h:17
Definition: stm_fraser.c:50
bool_t validate_stm_tx(ptst_t *ptst, stm_tx *t)
Definition: stm_fraser.c:474
Definition: stm_fraser.c:61
ptst_t * ptst
Definition: stmskip.cc:244
void * write_stm_blk(ptst_t *ptst, stm_tx *t, stm_blk *b)
Definition: stm_fraser.c:545
Definition: stm_fraser.c:39
int sizeof_stm_blk(ptst_t *ptst, stm *mem, stm_blk *b)
Definition: stm_fraser.c:293
void * init_stm_blk(ptst_t *ptst, stm *mem, stm_blk *b)
Definition: stm_fraser.c:287
int bool_t
Definition: portable_defns.h:32
void remove_from_tx(ptst_t *ptst, stm_tx *t, stm_blk *b)
Definition: stm_fraser.c:594
void * read_stm_blk(ptst_t *ptst, stm_tx *t, stm_blk *b)
Definition: stm_fraser.c:504
void abort_stm_tx(ptst_t *ptst, stm_tx *t)
Definition: stm_fraser.c:498
stm * new_stm(ptst_t *ptst, int blk_size)
Definition: stm_fraser.c:249
#define new_stm_tx(_tx, _ptst, _mem)
Definition: stm.h:37
void free_stm(ptst_t *ptst, stm *mem)
Definition: stm_fraser.c:258
void free_stm_blk(ptst_t *ptst, stm *mem, stm_blk *b)
Definition: stm_fraser.c:274
stm_blk * new_stm_blk(ptst_t *ptst, stm *mem)
Definition: stm_fraser.c:265
bool_t commit_stm_tx(ptst_t *ptst, stm_tx *t)
Definition: stm_fraser.c:321
int blk_size
Definition: stm_fraser.c:57
void _init_stm_subsystem(int pad_data)
Definition: stm_fraser.c:640