CS318 - Pintos
Pintos source browser for JHU CS318 course
Functions | Variables
alarm-priority.c File Reference
#include <stdio.h>
#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"
Include dependency graph for alarm-priority.c:

Go to the source code of this file.

Functions

void test_alarm_priority (void)
 
static void alarm_priority_thread (void *aux UNUSED)
 

Variables

static thread_func alarm_priority_thread
 Checks that when the alarm clock wakes up threads, the higher-priority threads run first. More...
 
static int64_t wake_time
 
static struct semaphore wait_sema
 

Function Documentation

◆ alarm_priority_thread()

static void alarm_priority_thread ( void *aux  UNUSED)
static

Definition at line 42 of file alarm-priority.c.

References msg(), sema_up(), start_time, thread_name(), timer_elapsed(), timer_sleep(), timer_ticks(), wait_sema, and wake_time.

Here is the call graph for this function:

◆ test_alarm_priority()

void test_alarm_priority ( void  )

Variable Documentation

◆ alarm_priority_thread

thread_func alarm_priority_thread
static

Checks that when the alarm clock wakes up threads, the higher-priority threads run first.

Definition at line 12 of file alarm-priority.c.

Referenced by test_alarm_priority().

◆ wait_sema

struct semaphore wait_sema
static

Definition at line 14 of file alarm-priority.c.

Referenced by alarm_priority_thread(), and test_alarm_priority().

◆ wake_time

int64_t wake_time
static

Definition at line 13 of file alarm-priority.c.

Referenced by alarm_priority_thread(), and test_alarm_priority().