Source: https://www.labri.fr/perso/johnen/pdf/IUT-Bordeaux/ProgConc/TdSemaphore.pdf