xiaoHoly edited a comment on pull request #14076:
URL: https://github.com/apache/flink/pull/14076#issuecomment-731061272


   To facilitate the discussion, I will post the code below:
   
   Method of  Thead A!
   public void await() throws InterruptedException {
                synchronized (lock) {
                        while (!triggered) {
                                Thread thread = Thread.currentThread();
                                try {
                                        waitersSet.add(thread);
                                        lock.wait();
                                } finally {
                                        waitersSet.remove(thread);
                                }
                        }
                }
        }
   
   Method of  Thead B!
        public void trigger() {
                synchronized (lock) {
                        triggered = true;
                        lock.notifyAll();
                }
        }


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to