coregrind/m_gdbserver/remote-utils.c (prepare_resume_reply): Use memcpy
[valgrind.git] / drd / tests / pth_mutex_reinit.c
blob1c72e819dfcc4a89a0904b0a500702189143d5b5
1 /* Test program that triggers mutex reinitialization. */
4 #define _GNU_SOURCE
6 #include <assert.h>
7 #include <pthread.h>
8 #include <stdio.h>
9 #include <stdlib.h>
12 int main(int argc, char** argv)
14 pthread_mutex_t m;
15 pthread_mutexattr_t attr;
17 pthread_mutexattr_init(&attr);
18 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
19 pthread_mutex_init(&m, &attr);
20 pthread_mutexattr_destroy(&attr);
21 pthread_mutex_lock(&m);
22 pthread_mutex_unlock(&m);
24 pthread_mutexattr_init(&attr);
25 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
26 pthread_mutex_init(&m, &attr);
27 pthread_mutexattr_destroy(&attr);
28 pthread_mutex_lock(&m);
29 pthread_mutex_unlock(&m);
31 pthread_mutex_destroy(&m);
33 fprintf(stderr, "Done.\n");
35 return 0;