Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- semaphore_wait(sem_Y_id,1); // opuszczam full Y
- semaphore_wait(sem_Z_id,1); // opuszczam full Z
- semaphore_wait(sem_Y_id,2); // opuszczam mutex
- semaphore_wait(sem_Z_id,2);
- wynik = buforY[0]*10 + buforZ[0];
- printf("Wyprodukowana liczba %d jako numer - %d \n",wynik,semaphore_get(sem_zlicz_id,0)+1);
- shift(buforY);
- shift(buforZ);
- semaphore_post(sem_zlicz_id,0);
- semaphore_post(sem_Y_id,2); //podnosze mutex
- semaphore_post(sem_Z_id,2);
- semaphore_post(sem_Y_id,0); //podnosze empty
- semaphore_post(sem_Z_id,0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement