CS318 - Pintos
Pintos source browser for JHU CS318 course
Data Fields
lock_and_sema Struct Reference

Low priority thread L acquires a lock, then blocks downing a semaphore. More...

Collaboration diagram for lock_and_sema:
Collaboration graph
[legend]

Data Fields

struct lock lock
 
struct semaphore sema
 

Detailed Description

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.nosp@m.@cs..nosp@m.vt.ed.nosp@m.u.

Definition at line 19 of file priority-donate-sema.c.

Field Documentation

◆ lock

struct lock lock_and_sema::lock

Definition at line 21 of file priority-donate-sema.c.

Referenced by h_thread_func(), l_thread_func(), and test_priority_donate_sema().

◆ sema

struct semaphore lock_and_sema::sema

The documentation for this struct was generated from the following file: