Changes
→Pseudocode
Return; // conditions for join not satisfied
} else {
add CurrentThread to joinedOnMe.waitingForAccess(currentThread)queue;
isJoined = true;
Sleep the currentThread;
}
Re-enable interrupts;
}
finish(){
// Interrupts have been disabled.
...(existing code)...
Ready the thread in the joinedOnMe threadqueue;
Sleep (existing);
}
==Condition.java==