All pastes #26002 Raw Edit

Mine

public text v1 · immutable
#26002 ·published 2005-10-19 21:44 UTC
rendered paste body
#include "global_Sem_Mutex.h"

// set pthread defaults
#define pthread_attr_default NULL
#define pthread_mutexattr_default NULL
#define pthread_condattr_default NULL


pthread_mutex_t grainMutex;		// gain access to grain variable
pthread_mutex_t grainAvailableMutex;	// there is grain available
pthread_mutex_t eCookiesMutex;		// gain access to elf cookies variable
pthread_mutex_t eCookiesAvailableMutex; // there are elf cookies available
pthread_mutex_t sCookiesMutex;		// gain access to student cookies variable
pthread_mutex_t sCookiesAvailableMutex;	// there are student cookies available
pthread_mutex_t codeMutex;		// gain access to code written variable
Semaphore tractors;		// keep track of how many tractors are being used
Semaphore ovens;		// keep track of how many ovens are being used
Semaphore trucks;		// keep track of how many trucks are being used
Semaphore computers;		// keep track of how many computers are being used
Semaphore threadRendevous;	// keep track of how many threads are done executing