5.3.1 What is semaphore? (6/10 Semaphore Primitives(原语,原子操作) struct semaphore t int count: crueueType queue void semWait(semaphore s) s. count if(s count 0) place this process in s queue b⊥ ck this process void semsigmal ( semaphore s) s. count++i if (s count <= 0) remove a process p from squeue; place process p on ready list Figure 5.3 A Definition of Semaphore Primitives5.3.1 What is semaphore?(6/10) • Semaphore Primitives(原语,原子操作) 9 P V