Open main menu

lensowiki β

Changes

Computer Science/162/proj1

4 bytes removed, 22:09, 4 October 2008
Implementation
===Implementation===
KThread has a new state variable joinedOnMe, a ThreadQueue, and isJoined, a boolean.
* When threadA calls threadB.join(), thread B adds it to its internal joinedOnMe queue and then puts it to sleep. In the finish() method, calls ready on the nextThread() on its joinedOnMe queue before returning. * Join() also checks that this thread is not equal to the current thread and that joinedOnMe is not already occupied by another thread with a boolean flag which determines whether join() has already been called on this thread.
===Testing===
Anonymous user