public void joinResource() throws InterruptedException {
  if (runObj != null) {
synchronized (complete) {
      if (runObj != null)       complete.wait();
    }
  }
}

public void joinResource ( ) throws InterruptedException { if ( runObj != null ) { synchronized ( complete ) { if ( runObj != null ) complete . wait ( ) ; } } }
waits for the resource to complete
