pintos/src/threads/synch.c File Reference

#include "threads/synch.h"
#include <stdio.h>
#include <string.h>
#include "threads/interrupt.h"
#include "threads/thread.h"

Go to the source code of this file.

Data Structures

struct  semaphore_elem

Functions

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


Function Documentation

void cond_broadcast ( struct condition cond,
struct lock lock 
)

Definition at line 332 of file synch.c.

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

void cond_init ( struct condition cond  ) 

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 cond,
struct lock *lock  UNUSED 
)

void cond_wait ( struct condition cond,
struct lock lock 
)

void lock_acquire ( struct lock lock  ) 

bool lock_held_by_current_thread ( const struct lock lock  ) 

void lock_init ( struct lock lock  ) 

void lock_release ( struct lock lock  ) 

bool lock_try_acquire ( struct lock lock  ) 

void sema_down ( struct semaphore sema  ) 

void sema_init ( struct semaphore sema,
unsigned  value 
)

void sema_self_test ( void   ) 

static void sema_test_helper ( void *  sema_  )  [static]

Definition at line 149 of file synch.c.

References sema, sema_down(), and sema_up().

Referenced by sema_self_test().

bool sema_try_down ( struct semaphore sema  ) 

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 sema  ) 


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