Is the following a critical section solution for 2 processes…

Is the following a critical section solution for 2 processes? Why? while (true) {    flag[i] = true;    while (flag[j]) {        if (turn == j) {            flag[i] = false;            while (turn == j)                ; /* do nothing */            flag[i] = true;        }    }        /* critical section */    turn = j;    flag[i] = false;        /* remainder section */}