pintos/src/threads/synch.h File Reference

#include <list.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  semaphore
struct  lock
struct  condition

Defines

#define barrier()   asm volatile ("" : : : "memory")

Functions

void sema_init (struct semaphore *, unsigned value)
void sema_down (struct semaphore *)
bool sema_try_down (struct semaphore *)
void sema_up (struct semaphore *)
void sema_self_test (void)
void lock_init (struct lock *)
void lock_acquire (struct lock *)
bool lock_try_acquire (struct lock *)
void lock_release (struct lock *)
bool lock_held_by_current_thread (const struct lock *)
void cond_init (struct condition *)
void cond_wait (struct condition *, struct lock *)
void cond_signal (struct condition *, struct lock *)
void cond_broadcast (struct condition *, struct lock *)


Define Documentation

 
#define barrier (  )     asm volatile ("" : : : "memory")

Definition at line 50 of file synch.h.

Referenced by busy_wait(), timer_ticks(), too_many_loops(), uhci_add_td_to_qh(), and uhci_create_chan().


Function Documentation

void cond_broadcast ( struct condition ,
struct lock  
)

Definition at line 332 of file synch.c.

References ASSERT, cond_signal(), list_empty(), NULL, and condition::waiters.

void cond_init ( struct condition  ) 

Definition at line 261 of file synch.c.

References ASSERT, list_init(), NULL, and condition::waiters.

Referenced by test_priority_condvar().

void cond_signal ( struct condition ,
struct lock  
)

void cond_wait ( struct condition ,
struct lock  
)

void lock_acquire ( struct lock  ) 

bool lock_held_by_current_thread ( const struct lock  ) 

void lock_init ( struct lock  ) 

void lock_release ( struct lock  ) 

bool lock_try_acquire ( struct lock  ) 

void sema_down ( struct semaphore  ) 

void sema_init ( struct semaphore ,
unsigned  value 
)

void sema_self_test ( void   ) 

bool sema_try_down ( struct semaphore  ) 

Definition at line 85 of file synch.c.

References ASSERT, intr_disable(), intr_set_level(), NULL, and semaphore::value.

Referenced by lock_try_acquire().

void sema_up ( struct semaphore  ) 


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6