Open main menu

lensowiki β

Changes

Computer Science/162/proj1

103 bytes added, 22:05, 4 October 2008
Implementation: formatting
==KThread.join()==
===Implementation===
{{c|KThread }} has a new state variable {{c|joinedOnMe}}, a {{c|ThreadQueue}}. * When {{c|threadA }} calls {{c|threadB.join()}}, thread B {{c|threadB}} adds it to its internal {{c|joinedOnMe }} queue and then puts it to sleep. In the {{c|threadB}}'s {{c|finish() }} method, {{c|threadB}} calls {{c|nextThread() }} on its {{c|joinedOnMe }} queue before returning. * Join{{c|join() }} also checks that this thread is not equal to the current thread and that {{c|joinedOnMe }} is not already occupied by another thread with a boolean flag , which determines whether {{c|join() }} has already been called on this thread.
===Testing===
1,277
edits