ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > CLASS (2016-2017-1)-62903-06102-1 > 王树基-2014329620063 >
6.11 Version 0
👤 Author: by wsj2014329620063 2016-11-17 18:20:12
 

#include<stdio.h>

#include<stdlib.h>

#include<unistd.h>

#include<pthread.h>

#include<semaphore.h>

#include<fcntl.h>

#include<errno.h>

#define n 5   //the shop have five chairs

 

//design three semaphores: mutex,customer,barbers

sem_t mutex,customers,barbers;

int waiting=0;  //the number of waiting customers

int chair[5];

void * barber();

void * customer(void *arg);

&nbs

Please login to reply. Login

Reversion History

Loading...
No reversions found.