This shows you the differences between two versions of the page.
|
app:laboratoare:04 [2025/11/12 05:02] alexandru.bala [Variabile condiție] |
app:laboratoare:04 [2025/11/12 05:03] (current) alexandru.bala [Variabile condiție] |
||
|---|---|---|---|
| Line 360: | Line 360: | ||
| pthread_mutex_init (&mutex, NULL); | pthread_mutex_init (&mutex, NULL); | ||
| - | |||
| sem_init (&full_sem, 0, 0); | sem_init (&full_sem, 0, 0); | ||
| sem_init (&empty_sem, 0, 3); | sem_init (&empty_sem, 0, 3); | ||
| Line 380: | Line 379: | ||
| sem_destroy (&empty_sem); | sem_destroy (&empty_sem); | ||
| sem_destroy (&full_sem); | sem_destroy (&full_sem); | ||
| - | |||
| pthread_mutex_destroy (&mutex); | pthread_mutex_destroy (&mutex); | ||
| Line 495: | Line 493: | ||
| } | } | ||
| - | pthread_cond_init (&empty_cond, NULL); | + | pthread_cond_destroy (&empty_cond, NULL); |
| - | pthread_cond_init (&full_cond, NULL); | + | pthread_cond_destroy (&full_cond, NULL); |
| pthread_mutex_destroy(&mutex); | pthread_mutex_destroy(&mutex); | ||