drd/tests/std_thread2: Make this test independent of the libstdc++ version
[valgrind.git] / none / tests / pth_mutexspeed.c
blobad263e193dadcc7d2f4f768f2eca1b3239c6d356
2 #include <stdio.h>
3 #include <assert.h>
4 #include <pthread.h>
6 int main ( void )
8 const int n = 100000;
9 int i, r;
10 pthread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER;
11 printf("begin %d lock--unlocks\n", n);
12 for (i = 0; i < n; i++) {
13 r = pthread_mutex_lock(&mx);
14 r |= pthread_mutex_unlock(&mx);
15 assert(r == 0);
17 printf("done %d lock--unlocks\n", n);
18 return 0;