22.01.2014 Views

Sincronizzazione (join, mutex, condition), semaphore - Lucidi

Sincronizzazione (join, mutex, condition), semaphore - Lucidi

Sincronizzazione (join, mutex, condition), semaphore - Lucidi

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Inizializzazione statica<br />

<br />

Per il tipo di dato pthread_<strong>mutex</strong>_t, è definita la<br />

macro di inizializzazione<br />

PTHREAD_MUTEX_INITIALIZER<br />

<br />

Il <strong>mutex</strong> è un tipo definito "ad hoc" per gestire la<br />

mutua esclusione quindi il valore iniziale può<br />

essergli assegnato anche in modo statico mediante<br />

questa macro.<br />

/* Variabili globali */<br />

pthread_<strong>mutex</strong>_t a<strong>mutex</strong> = PTHREAD_MUTEX_INITIALIZER;<br />

<strong>Sincronizzazione</strong> 25

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

Saved successfully!

Ooh no, something went wrong!