diff --git a/src/main/java/com/fazecast/jSerialComm/NativeSynchronizedInvoker.java b/src/main/java/com/fazecast/jSerialComm/NativeSynchronizedInvoker.java index b4f1f38..ce9702b 100644 --- a/src/main/java/com/fazecast/jSerialComm/NativeSynchronizedInvoker.java +++ b/src/main/java/com/fazecast/jSerialComm/NativeSynchronizedInvoker.java @@ -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"); + } }