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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user