Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add more Mc Mini tests
[simgrid.git] / teshsuite / mc / mcmini / simple_mutex_deadlock.c
1 #include <pthread.h>
2
3 pthread_mutex_t mutex1;
4 pthread_mutex_t mutex2;
5
6 int main(int argc, char* argv[]) {
7     pthread_mutex_init(&mutex1, NULL);
8     pthread_mutex_init(&mutex2, NULL);
9
10     pthread_mutex_lock(&mutex1);
11     pthread_mutex_lock(&mutex2);
12     pthread_mutex_unlock(&mutex2);
13     pthread_mutex_lock(&mutex1);
14     pthread_mutex_unlock(&mutex1);
15
16     return 0;
17 }
18