What does lockCanvas mean (elaborate)
<p>I'v been coming to drawing graphics in Android. There's a lot of sample applications out there, but one thing I always seeing is lockCanvas. Can someone explain it closer since I really don't get it and also because im think it's important to understand to future programming?</p>

<p>An example:            </p>

<pre><code>try { 
                c = panel_thread.getHolder().lockCanvas(null);

                synchronized (panel_thread.getHolder()) {
                 panel_thread.update();
                 panel_thread.onDraw(c);
                }
            }
</code></pre>

<p>This is what I have for now.
How should I interpret this correct? What does synchronized do? Why is it important to assign the canvas-object into a getHolder and lockCanvas?</p>

<p>This part is also confusing:</p>

<pre><code>panel_thread.getHolder().unlockCanvasAndPost(c);
</code></pre>

<p>Why is this necessary? I really need a closer explanation. :)</p>

<p>Thanks!</p>
