void dejar_tenedores(int i) { int der = (i + 1) % N; int izq = (i - 1) % N; wait(&mutex); estado[i] = pensando; prueba(izq); prueba(der); signal(&mutex); }
void tomar_tenedores(int i) { wait(&mutex); printf("\nEl filosofo %d esta hambriento", i+1); estado[i] = hambriento; prueba(i); signal(&mutex); wait(&s[i]); }
int main(int argc,char *argv[]) { prueba(); PRECONDICION(argc==1,"ERROR DE ARGUMENTOS"); while (ourBioskey(1)==0) ourBioskey(0); warningPRINTF("programa: %s\nnĂºmero de argumentos: %d",argv[0],argc); ourDelay(1000); errorPRINTF("programa: %s\nnĂºmero de argumentos: %d",argv[0],argc); return 0; }
int PASCAL WinMain(HINSTANCE hCurInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { prueba(); PRECONDICION(lpCmdLine!=NULL,"ERROR EN LINEA_COMANDOS PROGRAMA WIN32"); while (ourBioskey(1)==0) ourBioskey(0); warningPRINTF("linea comandos:\n%s",lpCmdLine); ourDelay(1000); errorPRINTF("linea comandos:\n%s",lpCmdLine); return 0; }
void display(void){ //poligono(); prueba(); }//display