Fix instructions tests

This commit is contained in:
Quentin Legot
2023-05-07 16:02:48 +02:00
parent 5000c28b97
commit c862c42e43
3 changed files with 106 additions and 109 deletions

View File

@@ -9,20 +9,6 @@ int tab[3];
SemId svide;
SemId splein;
void producteur();
void consommateur();
int main() {
svide = SemCreate("producteur", N);
splein = SemCreate("consommateur", 0);
ThreadId producteurTh = threadCreate("producteur", producteur);
ThreadId consommateurTh = threadCreate("consommateur", consommateur);
Join(producteurTh);
Join(consommateurTh);
return 0;
}
void producteur() {
for(int i = 0; i < 10; i++)
{
@@ -46,3 +32,13 @@ void consommateur() {
n_printf("exploiter l'information : %d\n", info);
}
}
int main() {
svide = SemCreate("producteur", N);
splein = SemCreate("consommateur", 0);
ThreadId producteurTh = threadCreate("producteur", producteur);
ThreadId consommateurTh = threadCreate("consommateur", consommateur);
Join(producteurTh);
Join(consommateurTh);
return 0;
}