Ajout Exo1
This commit is contained in:
30
ANALE-1/EXO2/RESOLUTION/p1.c
Normal file
30
ANALE-1/EXO2/RESOLUTION/p1.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/shm.h>
|
||||
#include "dijkstra.h"
|
||||
#include "commun.h"
|
||||
|
||||
void t1()
|
||||
{
|
||||
puts("t1");
|
||||
sleep(10);
|
||||
puts("end t1");
|
||||
}
|
||||
|
||||
void t2()
|
||||
{
|
||||
puts("t2");
|
||||
sleep(2);
|
||||
puts("end t2");
|
||||
}
|
||||
|
||||
int main () {
|
||||
int sem_t1 = sem_create (CLE_SEM_T1,0);
|
||||
int sem_t2 = sem_create (CLE_SEM_T2,0);
|
||||
t1();
|
||||
V(sem_t1);
|
||||
t2();
|
||||
V(sem_t2);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user