jclouds-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds] JCLOUDS-127 (#32)
Date Sat, 15 Jun 2013 15:17:14 GMT
>     public void addToClose(Closeable toClose) {
>        methodsToClose.add(toClose);
>     }
>  
>     public void close() throws IOException {
> -      Collections.reverse(methodsToClose);
> -      for (Closeable toClose : methodsToClose) {
> -         toClose.close();
> +      if (state.compareAndSet(State.OPEN, State.CLOSING)) {

This is now a change in logic...`close` will only be called **once** now. Previously, it was
possible to call `close` multiple times, and the closer would run multiple times too.

I think the new logic is _nicer_ but I think we should try to verify whether this might impact
users...

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/32/files#r4714168

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message