#ifdef _TM #define LOCK __transaction_atomic { #define UNLOCK } #endif #ifdef _LOCK #include static pthread_mutex_t l = PTHREAD_MUTEX_INITIALIZER; #define LOCK pthread_mutex_lock (&l); #define UNLOCK pthread_mutex_unlock (&l); #endif int main (int argc, char **argv) { int a = 0, b = 1, c = 2; LOCK if (a < b) c++; UNLOCK return 0; }