looking at bytecode
This commit is contained in:
parent
dc95bb80fe
commit
6161ca51bd
|
@ -22,4 +22,24 @@ public class NativeSynchronizedInvoker {
|
|||
public static void testNotNativeUnSynchronizedCommPorts() {
|
||||
System.out.println(SerialPort.getNotNativeUnSynchronizedCommPorts());
|
||||
}
|
||||
|
||||
public void intokeSync() {
|
||||
iAmSynchronized();
|
||||
iAmSynchronized2();
|
||||
iAmNotSynchronized();
|
||||
}
|
||||
|
||||
public synchronized void iAmSynchronized() {
|
||||
System.out.println("hello");
|
||||
}
|
||||
|
||||
public void iAmSynchronized2() {
|
||||
synchronized (this) {
|
||||
System.out.println("hello");
|
||||
}
|
||||
}
|
||||
|
||||
public void iAmNotSynchronized() {
|
||||
System.out.println("hello");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue