Main Page | Data Structures | File List | Globals | Related Pages

timer.h File Reference

Timer facilities interface. More...

#include <list.h>
#include <scheduler.h>

Go to the source code of this file.

Data Structures

struct  Timer

Defines

#define TIMER_HZ   100

Functions

int timer_initialize (void)
 Initialize timer facilities.

unsigned int get_ticks (void)
 The number of ticks since boot.

Timer * timer_create (unsigned int delta)
 Create a new timer.

void timer_activate (Timer *timer)
 Activate a timer.

void timer_destroy (Timer *timer)
 Destroy a timer.


Detailed Description

Timer facilities interface.

Provides the interface for simple deadline timers.

Bug:
No known bugs.
Author:
Lee Salzman (lsalzman)

Function Documentation

unsigned int get_ticks void   ) 
 

The number of ticks since boot.

Return the number of ticks elapsed since initializing the timer.

Returns:
the number of ticks

void timer_activate Timer *  timer  ) 
 

Activate a timer.

Install the timer so that it will expire at its deadline.

Parameters:
timer the timer to activate
Returns:
Void

Timer* timer_create unsigned int  delta  ) 
 

Create a new timer.

Create a new timer to expire a certain number of ticks from now. The timer must be activated after threads have been suspended on the resource before it will wait for expiration.

Parameters:
delta the number of ticks that should elapse from now till expiration
Returns:
a timer on success NULL on failure

void timer_destroy Timer *  timer  ) 
 

Destroy a timer.

Free any memory resources associated with a timer.

Parameters:
timer the timer to destroy
Returns:
Void

int timer_initialize void   ) 
 

Initialize timer facilities.

Initialize the timer facilities and start up the timer.

Returns:
0 on success -1 on failure


Generated on Fri Apr 9 21:59:16 2004 for 15-410 Project 3 by doxygen 1.3.2