public void startUsingModel ( ) { if ( replacementThread != null ) { try { replacementThread . join ( ) ; } catch ( InterruptedException e ) { } } replacementCanProceed = false ; users ++ ; }
Inform the manager that a thread is using the model . If a replacement is underway the thread is forced to join the replacement thread and thus wait until it is finished to begin using the model .