Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do {
- waiting[i] = TRUE; key = TRUE;
- while (waiting[i] && key) key = Swap(&lock, &key);
- waiting[i] = FALSE;
- / critical section /
- j = (i+1) % n; while ((j != i) && !waiting[j])
- j = (j+1) % n;
- if (j == i) lock = FALSE; else waiting[j] = FALSE;
- n/ remainder section /
- while (TRUE);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement