From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/tests/threads/priority-sema.c | 45 ----------------------------- 1 file changed, 45 deletions(-) delete mode 100644 pintos-progos/tests/threads/priority-sema.c (limited to 'pintos-progos/tests/threads/priority-sema.c') diff --git a/pintos-progos/tests/threads/priority-sema.c b/pintos-progos/tests/threads/priority-sema.c deleted file mode 100644 index 2834a88..0000000 --- a/pintos-progos/tests/threads/priority-sema.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Tests that the highest-priority thread waiting on a semaphore - is the first to wake up. */ - -#include -#include "tests/threads/tests.h" -#include "threads/init.h" -#include "threads/malloc.h" -#include "threads/synch.h" -#include "threads/thread.h" -#include "devices/timer.h" - -static thread_func priority_sema_thread; -static struct semaphore sema; - -void -test_priority_sema (void) -{ - int i; - - /* This test does not work with the MLFQS. */ - ASSERT (!thread_mlfqs); - - sema_init (&sema, 0); - thread_set_priority (PRI_MIN); - for (i = 0; i < 10; i++) - { - int priority = PRI_DEFAULT - (i + 3) % 10 - 1; - char name[16]; - snprintf (name, sizeof name, "priority %d", priority); - thread_create (name, priority, priority_sema_thread, NULL); - } - - for (i = 0; i < 10; i++) - { - sema_up (&sema); - msg ("Back in main thread."); - } -} - -static void -priority_sema_thread (void *aux UNUSED) -{ - sema_down (&sema); - msg ("Thread %s woke up.", thread_name ()); -} -- cgit v1.2.3