I am trying to check the correctness of this mutex solution, and need to check that mutual exclusion, liveness, and fairness are all satisfied. L1 and L2 are arbitrary lines of code. There are 2 processes running concurrently. Below is the code of process i, and the code of j is symmetrical.
bool waiting[i] = false;
bool waiting[j] = false;
bool busy = false;
cobegin(process i)
L1: Si(1)
L2: Si(2)
waiting[i] = true;
L3: while (waiting[i] and TST(busy));
L4: [ Critical Section ]
L5: waiting[i] = false;
L6: busy = false;
L7: while(waiting[j];
L8: Go to L2
I got that all three properties are satisfied, but I just need to make sure I didn't miss anything. Can you find a property that is not satisfied?