>>>>> "SH" == Steven Hazel <[EMAIL PROTECTED]> writes:

    SH> A synchronized method in Java is one that
    SH> gets the lock associated with its owner object before it runs,
    SH> and releases it before it returns.  So there's no difference
    SH> between a synchronized method and a method that synchronizes
    SH> on "this" for the entirety of its body.

Except doesn't the lock happen -after- the method has started with a
synchronized block, and -before- the method starts with the
synchronized method keyword? I'm not sure at all.

I don't know enough about JVMs to know if there is a difference, or
if:

        public synchronized void gar() { ...

..just compiles down to:

        public void gar() {
                synchronized(this) { ...

...in the end, or if it works more like (in a calling method):

        Spock spock = new Spock();

        synchronized(spock) {
                spock.gar();
        }        

I don't know if it even matters, really. 'Swhy I asked in the first
place. B-)

~Mr. Bad

-- 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /\____/\   Mr. Bad <[EMAIL PROTECTED]>
 \      /   Pigdog Journal | http://pigdog.org/ | *Stay*Real*Bad*
 |  (X \x)   
 (    ((**) "If it's not bad, don't do it.
  \  <vvv>   If it's not crazy, don't say it." - Ben Franklin
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________
Freenet-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to