TinySTM  1.0.5
Functions
mod_cb.h File Reference

Module for user callbacks. More...

Go to the source code of this file.

Functions

int stm_on_commit (void(*on_commit)(void *arg), void *arg)
 Register an application-specific callback triggered when the current transaction commits. More...
 
int stm_on_abort (void(*on_abort)(void *arg), void *arg)
 Register an application-specific callback triggered when the current transaction aborts. More...
 
void mod_cb_init (void)
 Initialize the module. More...
 

Detailed Description

Module for user callbacks.

Author
Pascal Felber pasca.nosp@m.l.fe.nosp@m.lber@.nosp@m.unin.nosp@m.e.ch Patrick Marlier patri.nosp@m.ck.m.nosp@m.arlie.nosp@m.r@un.nosp@m.ine.c.nosp@m.h
Date
2007-2014

Function Documentation

void mod_cb_init ( void  )

Initialize the module.

This function must be called once, from the main thread, after initializing the STM library and before performing any transactional operation.

int stm_on_abort ( void(*)(void *arg)  on_abort,
void *  arg 
)

Register an application-specific callback triggered when the current transaction aborts.

The callback is automatically unregistered once the transaction commits or aborts. If the transaction commits, the callback is never triggered.

Parameters
on_abortFunction called upon transaction abort.
argParameter to be passed to the callback function.
Returns
1 if the callbacks have been successfully registered, 0 otherwise.
int stm_on_commit ( void(*)(void *arg)  on_commit,
void *  arg 
)

Register an application-specific callback triggered when the current transaction commits.

The callback is automatically unregistered once the transaction commits or aborts. If the transaction aborts, the callback is never triggered.

Parameters
on_commitFunction called upon successful transaction commit.
argParameter to be passed to the callback function.
Returns
1 if the callbacks have been successfully registered, 0 otherwise.