Hello,

in the following code

Code:
	  public void run() {
	    while (run) {
	      Canvas c = null;
	      try {
	        c = sh.lockCanvas(null);
	        synchronized (sh) {
	          doDraw(c);
	        }
	      } finally {
	        if (c != null) {
	          sh.unlockCanvasAndPost(c);
	        }
	      }
	    }
	  }
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.