xxyzz / ostep-hw

Operating Systems: Three Easy Pieces(OSTEP) homework and project solutions
GNU General Public License v3.0
763 stars 179 forks source link

Update mutex-nostarve.c #13

Closed alwaysbemodest closed 2 years ago

alwaysbemodest commented 2 years ago

you cannot put the Sem_post(&m->mutex) before the if-else statement since you will use the protected variable m->room1 later in the if predicate.

xxyzz commented 2 years ago

Thanks!