samples/individualsamples/src/org/apidesign/samples/Synchronization.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:57:15 +0200
changeset 144 cef9a41a770a
permissions -rw-r--r--
Design part is cleared from the non-colorized code snippets
jtulach@144
     1
package org.apidesign.samples;
jtulach@144
     2
jtulach@144
     3
public class Synchronization {
jtulach@144
     4
    private final Object anObject = new Object();
jtulach@144
     5
    
jtulach@144
     6
    public void methodUsingSynchronizedBlock() {
jtulach@144
     7
        // BEGIN: synchronize.anObject
jtulach@144
     8
        synchronized (anObject) {
jtulach@144
     9
            // do the critical stuff
jtulach@144
    10
        }
jtulach@144
    11
        // END: synchronize.anObject
jtulach@144
    12
    }
jtulach@144
    13
}