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