11 #ifndef API_STAMP_HPP__
12 #define API_STAMP_HPP__
29 #define STM_THREAD_T stm::TxThread
30 #define STM_SELF tm_descriptor
31 #define STM_STARTUP(numThread) tm_main_startup()
32 #define STM_SHUTDOWN() stm::sys_shutdown()
33 #define STM_NEW_THREAD() 0
34 #define STM_INIT_THREAD(t, id) tm_start(&t, thread_getId())
35 #define STM_FREE_THREAD(t)
36 #define STM_RESTART() stm::restart()
38 #define STM_LOCAL_WRITE_I(var, val) ({var = val; var;})
39 #define STM_LOCAL_WRITE_L(var, val) ({var = val; var;})
40 #define STM_LOCAL_WRITE_F(var, val) ({var = val; var;})
41 #define STM_LOCAL_WRITE_P(var, val) ({var = val; var;})
64 #define STM_BEGIN_WR() \
67 uint32_t abort_flags = setjmp(jmpbuf_); \
68 begin(static_cast<stm::TxThread*>(STM_SELF), &jmpbuf_, abort_flags);\
74 commit(static_cast<stm::TxThread*>(STM_SELF)); \
78 #define STM_BEGIN_RD() STM_BEGIN_WR()
115 #endif // API_STAMP_HPP__
void *volatile ptr
Definition: counted_ptr.hpp:57
void * tx_safe_non_tx_alloc(size_t size)
Definition: stamp.hpp:47
void sys_init(void(*abort_handler)(TxThread *)=NULL)
void tm_main_startup()
Definition: stamp.hpp:88
void tx_safe_non_tx_free(void *ptr)
Definition: stamp.hpp:56
void tm_start(stm::TxThread **desc, int id)
Definition: stamp.hpp:108
void thread_init()
Definition: library.hpp:196
Definition: txthread.hpp:47