code1 [OS] Deadlock 예제 코드 (with Java, C++) [Example 1 in Java] public class DeadLock { public static void main(String[] args) throws InterruptedException { Thread mainThread = Thread.currentThread(); Thread thread1 = new Thread(new Runnable() { @Override public void run() { try { mainThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } }); thread1.start(); thread1.join(); } } // https://stackoverflow.com/questions/1.. 2022. 7. 24. 이전 1 다음