src/core/interface.c File Reference

Public interface implementation. More...

#include <sys/time.h>
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <assert.h>
#include <sched.h>
#include <misc/debug.h>
#include <misc/generic_types.h>
#include <core/stats.h>
#include <core/sentinel.h>
#include <core/koa.h>
#include <core/fm.h>
#include <core/buffer.h>
#include <core/config.h>
#include <core/tx.h>

Go to the source code of this file.

Functions

int _TXC_global_init ()
 Performs global initialization of the library.
int _TXC_global_shutdown ()
 Shutdowns the library.
int _TXC_thread_init ()
 Initializes and assigns an xCalls descriptor to a thread.
void _TXC_transaction_abort (txc_tx_abortreason_t abort_reason)
 Aborts a transaction.
txc_tx_xactstate_t _TXC_get_xactstate ()
 Returns the transactional state of the current thread.
void _TXC_transaction_pre_begin (const char *srcloc_str, const char *src_file, const char *src_fun, int src_line)
 Informs the xCall library that a transaction is going to begin.
void _TXC_transaction_post_begin ()
 Informs the xCall library that a transaction has begun.
void _TXC_fm_register (int flags, int *err)
 Specifies what action to take when an asynchronous failure occurs.

Variables

txc_sentinelmgr_ttxc_g_sentinelmgr
txc_buffermgr_ttxc_g_buffermgr
txc_koamgr_ttxc_g_koamgr
txc_txmgr_ttxc_g_txmgr
txc_statsmgr_ttxc_g_statsmgr
timeval txc_initialization_time


Detailed Description

Public interface implementation.

Wrapper functions implementing the public interface of the library.

Definition in file interface.c.


Function Documentation

txc_tx_xactstate_t _TXC_get_xactstate (  ) 

Returns the transactional state of the current thread.

Returns:
Running outside a transaction (TXC_XACTSTATE_NONTRANSACTIONAL = 0), Running inside a retryable tranasction (TXC_XACTSTATE_TRANSACTIONAL_RETRYABLE = 1), Running inside an irrevocable (non-retryable) transaction TXC_XACTSTATE_TRANSACTIONAL_IRREVOCABLE = 2

Definition at line 124 of file interface.c.

References txc_l_txd, and txc_tx_get_xactstate().

int _TXC_global_init (  ) 

Performs global initialization of the library.

Creates all necessary managers.

Returns:
Returns 0 on success.

Definition at line 46 of file interface.c.

References txc_buffermgr_create(), txc_config_init(), txc_g_buffermgr, txc_g_koamgr, txc_g_sentinelmgr, txc_g_statsmgr, txc_g_txmgr, txc_koamgr_create(), TXC_R_SUCCESS, txc_runtime_settings, txc_sentinelmgr_create(), txc_statsmgr_create(), and txc_txmgr_create().

int _TXC_global_shutdown (  ) 

Shutdowns the library.

Todo:
Destroy all library objects.
Returns:
Returns 0 on success.

Definition at line 78 of file interface.c.

References txc_g_statsmgr, TXC_R_SUCCESS, and txc_stats_print().

int _TXC_thread_init (  ) 

Initializes and assigns an xCalls descriptor to a thread.

Returns:
Returns 0 on success.

Definition at line 92 of file interface.c.

References txc_g_txmgr, txc_l_txd, TXC_R_SUCCESS, and txc_tx_create().

void _TXC_transaction_abort ( txc_tx_abortreason_t  abort_reason  ) 

Aborts a transaction.

Requests the xCall library to abort a transaction.

Parameters:
[in] abort_reason Reason for abort.
Returns:
Never returns.

Definition at line 108 of file interface.c.

References txc_l_txd, and txc_tx_abort_transaction().

void _TXC_transaction_pre_begin ( const char *  srcloc_str,
const char *  src_file,
const char *  src_fun,
int  src_line 
)

Informs the xCall library that a transaction is going to begin.

Parameters:
[in] srcloc_str String describing the transaction's source location.
[in] src_file The file where the transaction is located.
[in] src_fun The function where the transaction is located.
[in] src_line The line number where the transaction is located.
Returns:
None

Definition at line 142 of file interface.c.

References txc_l_txd, and txc_tx_pre_begin().


Generated on Wed Dec 9 20:32:40 2009 for xCalls by  doxygen 1.4.7