added single-queue scheduler; the old scheduler is compiled by default - to enable the new one uncomment the #define at the beginning of thread.h

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@776 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
lillo
2002-08-16 13:14:29 +00:00
parent c3b1fb12fe
commit e196b7bbc5
4 changed files with 193 additions and 0 deletions
+20
View File
@@ -31,6 +31,19 @@ static int counter_thread(void *data)
return 0;
}
static int priority_test(void *data)
{
int i;
for (i=0; i<10; i++) {
printf("%s: %d\n", (char *)data, i);
// sys_snooze(1000);
}
return 0;
}
int main(int argc, char **argv)
{
thread_id t[THREADS];
@@ -62,5 +75,12 @@ int main(int argc, char **argv)
delete_sem(lock);
t[0] = spawn_thread(priority_test, "thread0", B_DISPLAY_PRIORITY, "thread0");
t[1] = spawn_thread(priority_test, "thread1", B_URGENT_DISPLAY_PRIORITY, "thread1");
resume_thread(t[0]);
resume_thread(t[1]);
sys_wait_on_thread(t[0], NULL);
sys_wait_on_thread(t[1], NULL);
return 0;
}