Lines Matching refs:turn
39 /* Used to sync up turns and keep track of who's turn it is */
51 private static TurnChecker turn = new TurnChecker(-1);
84 /* Get all threads running (they will block until we set turn) */
98 synchronized (turn) {
99 turn.thread_index = 0;
100 turn.notifyAll();
110 synchronized (turn) {
154 synchronized (turn) {
155 /* Keep waiting for our turn */
156 while (turn.thread_index != thread_index)
157 turn.wait();
165 /* Give next thread a turn */
166 turn.thread_index = next_thread_index;
167 turn.notifyAll();