11.04.2013 Views

Sezione critica

Sezione critica

Sezione critica

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Semaforo passivo: wait()<br />

• La funzione wait(S) si estende con il supporto<br />

di accodamento dei processi<br />

void wait(semaforo S) {<br />

S.valore--;<br />

if (S.valore < 0) {<br />

;<br />

}<br />

}<br />

block();<br />

mette il processo in stato<br />

di attesa<br />

42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!