Ajout exo5
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
*/
|
||||
int sem_create(key_t cle, int initval);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* take a token on the semaphore semid or wait if none available
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,12 @@ void t2()
|
||||
}
|
||||
|
||||
int main () {
|
||||
int semt1 = sem_create(CLE_SEM_T1,0);
|
||||
int semt2 = sem_create(CLE_SEM_T2,0);
|
||||
|
||||
t1();
|
||||
V(semt1);
|
||||
t2();
|
||||
V(semt2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user