PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
Low priority thread L acquires a lock, then blocks downing a semaphore. More...
Data Fields | |
struct lock | lock |
struct semaphore | sema |
Low priority thread L acquires a lock, then blocks downing a semaphore.
Medium priority thread M then blocks waiting on the same semaphore. Next, high priority thread H attempts to acquire the lock, donating its priority to L.
Next, the main thread ups the semaphore, waking up L. L releases the lock, which wakes up H. H "up"s the semaphore, waking up M. H terminates, then M, then L, and finally the main thread.
Written by Godmar Back gback. @cs. vt.ed u
Definition at line 19 of file priority-donate-sema.c.
struct lock lock_and_sema::lock |
Definition at line 21 of file priority-donate-sema.c.
Referenced by h_thread_func(), and l_thread_func().
struct semaphore lock_and_sema::sema |
Definition at line 22 of file priority-donate-sema.c.
Referenced by h_thread_func(), l_thread_func(), and m_thread_func().