src/xcalls/condvar/condvar.h File Reference

Transactional condition variable MACROs. More...

#include "futex.h"

Go to the source code of this file.

Defines

#define _BEGIN_TX   __tm_atomic
#define _END_TX
#define txc_cond_event_inc_loops(_ev_)   txc_cond_event_inc(_ev_)
#define LABEL_CAT(a, b)   LABEL_CAT_I(a, b)
#define LABEL_CAT_I(a, b)   a ## b
#define NEXT_LABEL(T)   LABEL_HELPER(T,LABEL_CAT(label,__LINE__))
#define LABEL_HELPER(T, L)   do { T = &&L; L: __dummy = 0;} while(0)
#define COND_XACT_BEGIN
#define COND_XACT_END
#define txc_cond_wait_label(_cvar_, _label_)
#define txc_cond_wait(_cvar_)


Detailed Description

Transactional condition variable MACROs.

Notes on condition variables:

Definition in file condvar.h.


Define Documentation

#define COND_XACT_BEGIN

Value:

{                                                                           \
   int __do_wait = 0, __cond_val, __do_exit = 0;                             \
   int __dummy = 0;                                                          \
   txc_cond_event_t * __cond_var;                                            \
   void * __wait_label;                                                      \
   void * __begin_label;                                                     \
   do {                                                                      \
     if (__do_wait) {                                                        \
       txc_cond_event_deferred_wait(__cond_var,__cond_val);                  \
     }                                                                       \
     _BEGIN_TX {                                                             \
       NEXT_LABEL(__begin_label);                                            \
       if (!__do_exit) {                                                     \
         if (__do_wait) {                                                    \
           __do_wait = 0;                                                    \
           goto *__wait_label;                                               \
         }

Definition at line 27 of file condvar.h.

#define COND_XACT_END

Value:

} else {__do_exit = 0;} }                                             \
     _END_TX;                                                                \
   } while (__do_wait); }

Definition at line 46 of file condvar.h.

#define txc_cond_wait ( _cvar_   ) 

Value:

do {                                                                        \
   txc_cond_event_inc_loops( _cvar_ );                                       \
   txc_cond_wait_label( _cvar_, LABEL_CAT(__txc_cond_wait_, __LINE__));      \
 } while (0)

Definition at line 65 of file condvar.h.

#define txc_cond_wait_label ( _cvar_,
_label_   ) 

Value:

{                                                                           \
   __cond_var = (_cvar_);                                                            \
   __cond_val = txc_cond_event_get(_cvar_);                                      \
   __do_wait = 1;                                                            \
   __do_exit = 1;                                                            \
   __wait_label = && _label_;                                                \
   goto *__begin_label;                                                      \
   _label_:                                                                  \
   __dummy = 0;                                                              \
 }

Definition at line 52 of file condvar.h.


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