next up previous contents
Next: Summary Up: Semaphores: Implementation Previous: Implementation   Contents

Structure Types & Global Variables

struct sema
This is the type for declaring semaphores defined in sema.h. This structure has variables

struct sema_wait_que
This is type used for maintaining a queue of threads waiting on a semaphore. It is defined in sema_que.h. The main variables of this structure are

struct sema_timeout_que
This is the type used to maintain the timout information for various sema_wait functions . It is defined in sema_que.h. The main variables of this structure are

struct sema_timeout_que global_stq
This global variable is used to maintain the timeouts.

spinlock_t global_sema_lock
This global variable is used to lock the semaphore library data structures.

 void sema_time_handler(void)
This function is called by the kernel periodically & it updates global_stq removing threads & associated structures, whose timeouts have happened from the various queues.
next up previous contents
Next: Summary Up: Semaphores: Implementation Previous: Implementation   Contents
Soumyadeb Mitra 2002-08-07