rem: void add(int value) { pthread_mutex_lock(&mutex_rep); value_rep += value; pthread_mutex_unlock(&mutex_rep); }
add: void ATOMIC_INTEGER::add(int value) { #ifdef USE_ASM_ATOMIC atomic_add(value, reinterpret_cast<atomic_t*>(value_repp)); #else pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(mutex_repp); pthread_mutex_lock(mutex); value_rep += value; pthread_mutex_unlock(mutex); #endif }
context:   void add(int value) {    pthread_mutex_lock(&mutex_rep);    value_rep += value;    pthread_mutex_unlock(&mutex_rep);  }