标签:string system color span 同步 stat pre oid null
public class LockSupport01 { static Thread t1 = null, t2 = null; public static void main(String[] args) { char[] aI = "1234567".toCharArray(); char[] aC = "ABCDEFG".toCharArray(); t1 = new Thread(()->{ for (char c : aI) { System.out.print(c); LockSupport.unpark(t2); LockSupport.park(); } }); t2 = new Thread(()-> { for (char c : aC) { LockSupport.park(); System.out.print(c); LockSupport.unpark(t1); } }); t1.start(); t2.start(); } }
标签:string system color span 同步 stat pre oid null
原文地址:https://www.cnblogs.com/wgDream/p/12038866.html