in the following code

	  public void run() {
	    while (run) {
	      Canvas c = null;
	      try {
	        c = sh.lockCanvas(null);
	        synchronized (sh) {
	      } finally {
	        if (c != null) {
I understand that the doDraw method should be done exclusively by my thread and not be interfered by some other thread. What I don't understand is why I have to provide a parameter (here sh which is a class variable), especially a parameter which doesn't seem to be used in the part which needs to be synchronized.

thanks, J.