diff --git a/code/test/threadcreate.c b/code/test/threadcreate.c index 23d896b..9861c8b 100644 --- a/code/test/threadcreate.c +++ b/code/test/threadcreate.c @@ -2,8 +2,13 @@ #include "syscall.h" void f(int c) { - PutChar((char)c); - //GetChar(); + /* Since our stack is shared with other threads, we've got + * a problem here, when executing a thread there is not 8 iterations. + * This is like synchronisation */ + volatile int i; + for (i=0;i<8;i++){ + PutChar((char)c); + } ThreadExit(); } @@ -12,7 +17,7 @@ int main(){ for (i=64; i < 68; i++){ ThreadCreate(f, i); } - PutString("end of main()\n"); + // PutString("end of main()\n"); ThreadExit(); //return 0; }