Fix instructions tests
This commit is contained in:
@ -2,9 +2,10 @@
|
||||
#include "userlib/libnachos.h"
|
||||
|
||||
int main() {
|
||||
n_printf("Hello World 1");
|
||||
n_printf("Hello World 2");
|
||||
n_printf("Hello World 3");
|
||||
n_printf("Hello World 4");
|
||||
n_printf("Hello World 1\n");
|
||||
n_printf("Hello World 2\n");
|
||||
n_printf("Hello World 3\n");
|
||||
n_printf("Hello World 4\n");
|
||||
Shutdown();
|
||||
return 0;
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user