Skip to content

Instantly share code, notes, and snippets.

@OMGZui
Last active June 28, 2022 15:22
Show Gist options
  • Save OMGZui/5709f56d032e1074dee64abcb87822d9 to your computer and use it in GitHub Desktop.
Save OMGZui/5709f56d032e1074dee64abcb87822d9 to your computer and use it in GitHub Desktop.
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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment