Changes

Jump to: navigation, search

Computer Science/162/proj1

63 bytes removed, 22:08, 4 October 2008
Implementation
==KThread.join()==
===Implementation===
{{c|KThread}} has a new state variable {{c|joinedOnMe}}, a {{c|ThreadQueue}}, and isJoined, a boolean. * When {{c|threadA}} calls {{c|threadB.join()}}, {{c|threadB}} thread B adds it to its internal {{c|joinedOnMe}} queue and then puts it to sleep. In {{c|threadB}}'s {{c|the finish()}} method, {{c|threadB}} calls {{c|ready on the nextThread()}} on its {{c|joinedOnMe}} queue before returning. * {{c|join• 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===
Anonymous user

Navigation menu