tisonkun commented on code in PR #479:
URL: https://github.com/apache/curator/pull/479#discussion_r1324654459
##########
curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/CuratorCacheImpl.java:
##########
@@ -59,14 +59,29 @@ class CuratorCacheImpl implements CuratorCache,
CuratorCacheBridge {
private final StandardListenerManager<CuratorCacheListener>
listenerManager = StandardListenerManager.standard();
private final Consumer<Exception> exceptionHandler;
- private final Phaser outstandingOps = new Phaser() {
+ private final Phaser rootPhaser = new Phaser() {
@Override
protected boolean onAdvance(int phase, int registeredParties) {
callListeners(CuratorCacheListener::initialized);
+ synchronized (CuratorCacheImpl.this) {
+ currentChildPhaser = rootPhaser;
+ }
return true;
}
};
+ private Phaser currentChildPhaser = new Phaser(rootPhaser);
+
+ private synchronized Phaser getPhaserAndRegister() {
+ if (currentChildPhaser.getRegisteredParties() >= 0xffff) {
+ currentChildPhaser = new Phaser(rootPhaser);
Review Comment:
```suggestion
currentChildPhaser = new Phaser(currentChildPhaser);
```
?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]