Changes in benchmark/mutex/pthreads.c [dc33b5b:b4107c8]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/mutex/pthreads.c
rdc33b5b rb4107c8 7 7 8 8 void __attribute__((noinline)) call() { 9 pthread_mutex_lock (&mutex);10 pthread_mutex_unlock( &mutex);9 pthread_mutex_lock( &mutex ); 10 pthread_mutex_unlock( &mutex ); 11 11 } 12 13 int main(int argc, char* argv[]) { 12 int main( int argc, char * argv[] ) { 13 BENCH_START() 14 14 BENCH( 15 for ( size_t i = 0; i < n; i++) {15 for ( size_t i = 0; i < times; i++ ) { 16 16 call(); 17 17 }, 18 18 result 19 19 ) 20 printf( "%g\n", result ); 21 } 20 22 21 printf("%g\n", result); 22 } 23 // Local Variables: // 24 // tab-width: 4 // 25 // End: //
Note: See TracChangeset
for help on using the changeset viewer.