@Target(value=METHOD) @Retention(value=CLASS) public @interface DoNotTrace
public class UpdateWithDoNotTrace { private int i = 0; final CountDownLatch countDownLatch = new CountDownLatch(1); @DoNotTrace private void signal() { countDownLatch.countDown(); } @DoNotTrace private void wait4Signal() throws InterruptedException { countDownLatch.await(); } public void updateBefore() { i++; signal(); } public void updateAfter() throws InterruptedException { wait4Signal(); i++; } }
Copyright © 2020 vmlens. All rights reserved.