Github user tdas commented on a diff in the pull request: https://github.com/apache/spark/pull/15497#discussion_r83568089 --- Diff: core/src/main/scala/org/apache/spark/util/ManualClock.scala --- @@ -60,18 +66,21 @@ private[spark] class ManualClock(private var time: Long) extends Clock { */ def waitTillTime(targetTime: Long): Long = synchronized { _isWaiting = true + _readyForFirstPeek = true try { while (time < targetTime) { wait(10) } getTimeMillis() } finally { _isWaiting = false + _readyForFirstPeek = false } } /** - * Returns whether there is any thread being blocked in `waitTillTime`. + * Returns whether there is any thread being blocked in `waitTillTime`, and this will be the first + * time it's been peeked in the blocking state. */ - def isWaiting: Boolean = synchronized { _isWaiting } + def isWaitingAndReadyForFirstPeek: Boolean = synchronized { _isWaiting && _readyForFirstPeek } --- End diff -- Guess it boils down to what is the purpose of _readyForPeek, which is not clear to me.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org