add my own broken example for uiowa-threads.c
parent
8141a18cab
commit
a5638de011
@ -0,0 +1,28 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "uiowa-threads.h"
|
||||||
|
|
||||||
|
void test_thread(int n) {
|
||||||
|
for (int i=0; i<10; i++) {
|
||||||
|
printf("thread %d: %d\n", n, i);
|
||||||
|
thread_relinquish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_thread2(int n) {
|
||||||
|
for (int i=0; i<10; i++) {
|
||||||
|
printf("thread %d: %d\n", n, i);
|
||||||
|
thread_relinquish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
thread_manager_init();
|
||||||
|
thread_startup_report();
|
||||||
|
|
||||||
|
thread_launch(4000, test_thread, 1);
|
||||||
|
thread_launch(4000, test_thread2, 2);
|
||||||
|
|
||||||
|
thread_manager_start();
|
||||||
|
/* control never reaches this point */
|
||||||
|
}
|
Loading…
Reference in New Issue