没 bug ,先 unpark 的话,下次 park 会失效,应该是有个标志位,能抵消一次 park
```java
@
Test public void test() throws InterruptedException {
Thread thread = new Thread(() -> {
try {
TimeUnit.SECONDS.sleep(3);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
System.out.println("start park in thread 1");
LockSupport.park(Thread.currentThread());
System.out.println("start park in thread 2");
LockSupport.park(Thread.currentThread());
System.out.println("end park in thread");
});
thread.start();
TimeUnit.SECONDS.sleep(1);
System.out.println("start unpark in main");
LockSupport.unpark(thread);
LockSupport.unpark(thread);
System.out.println("end unpark in main");
TimeUnit.SECONDS.sleep(4);
LockSupport.unpark(thread);
TimeUnit.SECONDS.sleep(100);
}
```