Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add more Mc Mini tests
[simgrid.git] / teshsuite / mc / mcmini / simple_mutex_ok.c
1 #include <pthread.h>
2 #include <stdio.h>
3
4 pthread_mutex_t mutex1;
5 pthread_mutex_t mutex2;
6
7 int main(int argc, char* argv[]) {
8
9     if(argc != 1) {
10         printf("Expected usage: %s \n", argv[0]);
11         return -1;
12     }
13
14     pthread_mutex_init(&mutex1, NULL);
15     pthread_mutex_init(&mutex2, NULL);
16
17     pthread_mutex_lock(&mutex1);
18     pthread_mutex_lock(&mutex2);
19     pthread_mutex_unlock(&mutex2);
20     pthread_mutex_unlock(&mutex1);
21
22     pthread_mutex_destroy(&mutex1);
23     pthread_mutex_destroy(&mutex2);
24
25     return 0;
26 }