You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "csulyj (JIRA)" <ji...@apache.org> on 2015/12/23 13:43:46 UTC
[jira] [Commented] (CURATOR-283) LockInternals does not deal with
spurious weakup?
[ https://issues.apache.org/jira/browse/CURATOR-283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15069589#comment-15069589 ]
csulyj commented on CURATOR-283:
--------------------------------
If the test happens outside of the same synchronized block that contains the wait() call then; thread A could perform the test, and decide it needs to wait(), thread B could change the condition and call notify(), and then thread A could enter a wait() call for which the notify() has already been given... and lost. Thread A then never wakes up.
> LockInternals does not deal with spurious weakup?
> -------------------------------------------------
>
> Key: CURATOR-283
> URL: https://issues.apache.org/jira/browse/CURATOR-283
> Project: Apache Curator
> Issue Type: Test
> Components: Recipes
> Reporter: csulyj
> Priority: Trivial
>
> I don't understand why method internalLockLoop doesn't not deal with spurious weakup?
> I think it should be like this :
> synchronized (obj) {
> while (condition does not hold)
> obj.wait(timeout);
> ... // Perform action appropriate to condition
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)