#define NUM_THREADS 5 void *thread( void *t_id ) { int i; for ( i = 0; i < 200; ++i ) { pthread_mutex_lock( &data.mutex ); ++data.value; printf( "thread %d: data value = %d\n", t_id, data.value ); pthread_mutex_unlock( &data.mutex ); } pthread_exit( NULL ); }