Created
June 28, 2022 14:55
-
-
Save OMGZui/5a2a5e3989c3c3066244d3e64ad19b4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class medium01Test{ | |
public static void main(String[] args) { | |
SyncThread syncThread = new SyncThread(); | |
Thread F_thread1 = new Thread(new SyncThread(), "F_thread1"); | |
Thread F_thread2 = new Thread(new SyncThread(), "F_thread2"); | |
Thread F_thread3 = new Thread(syncThread, "F_thread3"); | |
Thread F_thread4 = new Thread(syncThread, "F_thread4"); | |
F_thread1.start(); | |
F_thread2.start(); | |
F_thread3.start(); | |
F_thread4.start(); | |
} | |
} | |
F_thread1_Sync: 22:53:35 | |
F_thread4_Sync: 22:53:35 | |
F_thread3_Sync: 22:53:35 | |
F_thread1_Sync_Start: 22:53:35 | |
F_thread2_Sync: 22:53:35 | |
F_thread1_Sync_End: 22:53:37 | |
F_thread2_Sync_Start: 22:53:37 | |
F_thread2_Sync_End: 22:53:39 | |
F_thread3_Sync_Start: 22:53:39 | |
F_thread3_Sync_End: 22:53:41 | |
F_thread4_Sync_Start: 22:53:41 | |
F_thread4_Sync_End: 22:53:43 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment