source: tags/minix3.1.2a-orig/minix/servers/ss/semaforo.c@ 13

Last change on this file since 13 was 13, checked in by Mattia Monga, 13 years ago

Server semaforo

File size: 356 bytes
Line 
1#include "semaforo.h"
2
3PUBLIC int accoda(semaforo *ss, int who){
4 if (ss->quanti < MAX_CODA){
5 ss->coda[ss->quanti++] = who;
6 return ss->quanti;
7 }
8 return -1;
9}
10
11PUBLIC int scoda(semaforo *ss){
12 if (ss->quanti > 0){
13 return ss->coda[--ss->quanti];
14 }
15 return -1;
16}
17
18
19
Note: See TracBrowser for help on using the repository browser.