class io.vertx.core.impl.CloseHooks
  minor version: 0
  major version: 59
  flags: flags: (0x0020) ACC_SUPER
  this_class: io.vertx.core.impl.CloseHooks
  super_class: java.lang.Object
{
  private final io.vertx.core.logging.Logger log;
    descriptor: Lio/vertx/core/logging/Logger;
    flags: (0x0012) ACC_PRIVATE, ACC_FINAL

  private boolean closeHooksRun;
    descriptor: Z
    flags: (0x0002) ACC_PRIVATE

  private java.util.Set<io.vertx.core.Closeable> closeHooks;
    descriptor: Ljava/util/Set;
    flags: (0x0002) ACC_PRIVATE
    Signature: Ljava/util/Set<Lio/vertx/core/Closeable;>;

  void <init>(io.vertx.core.logging.Logger);
    descriptor: (Lio/vertx/core/logging/Logger;)V
    flags: (0x0000) 
    Code:
      stack=2, locals=2, args_size=2
        start local 0 // io.vertx.core.impl.CloseHooks this
        start local 1 // io.vertx.core.logging.Logger log
         0: .line 35
            aload 0 /* this */
            invokespecial java.lang.Object.<init>:()V
         1: .line 36
            aload 0 /* this */
            aload 1 /* log */
            putfield io.vertx.core.impl.CloseHooks.log:Lio/vertx/core/logging/Logger;
         2: .line 37
            return
        end local 1 // io.vertx.core.logging.Logger log
        end local 0 // io.vertx.core.impl.CloseHooks this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    3     0  this  Lio/vertx/core/impl/CloseHooks;
            0    3     1   log  Lio/vertx/core/logging/Logger;
    MethodParameters:
      Name  Flags
      log   

  synchronized void add(io.vertx.core.Closeable);
    descriptor: (Lio/vertx/core/Closeable;)V
    flags: (0x0020) ACC_SYNCHRONIZED
    Code:
      stack=3, locals=2, args_size=2
        start local 0 // io.vertx.core.impl.CloseHooks this
        start local 1 // io.vertx.core.Closeable hook
         0: .line 45
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.closeHooks:Ljava/util/Set;
            ifnonnull 2
         1: .line 47
            aload 0 /* this */
            new java.util.HashSet
            dup
            invokespecial java.util.HashSet.<init>:()V
            putfield io.vertx.core.impl.CloseHooks.closeHooks:Ljava/util/Set;
         2: .line 49
      StackMap locals:
      StackMap stack:
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.closeHooks:Ljava/util/Set;
            aload 1 /* hook */
            invokeinterface java.util.Set.add:(Ljava/lang/Object;)Z
            pop
         3: .line 50
            return
        end local 1 // io.vertx.core.Closeable hook
        end local 0 // io.vertx.core.impl.CloseHooks this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    4     0  this  Lio/vertx/core/impl/CloseHooks;
            0    4     1  hook  Lio/vertx/core/Closeable;
    MethodParameters:
      Name  Flags
      hook  

  synchronized boolean remove(io.vertx.core.Closeable);
    descriptor: (Lio/vertx/core/Closeable;)Z
    flags: (0x0020) ACC_SYNCHRONIZED
    Code:
      stack=2, locals=2, args_size=2
        start local 0 // io.vertx.core.impl.CloseHooks this
        start local 1 // io.vertx.core.Closeable hook
         0: .line 59
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.closeHooks:Ljava/util/Set;
            ifnull 2
         1: .line 60
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.closeHooks:Ljava/util/Set;
            aload 1 /* hook */
            invokeinterface java.util.Set.remove:(Ljava/lang/Object;)Z
            ireturn
         2: .line 62
      StackMap locals:
      StackMap stack:
            iconst_0
            ireturn
        end local 1 // io.vertx.core.Closeable hook
        end local 0 // io.vertx.core.impl.CloseHooks this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    3     0  this  Lio/vertx/core/impl/CloseHooks;
            0    3     1  hook  Lio/vertx/core/Closeable;
    MethodParameters:
      Name  Flags
      hook  

  void run(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>);
    descriptor: (Lio/vertx/core/Handler;)V
    flags: (0x0000) 
    Code:
      stack=5, locals=10, args_size=2
        start local 0 // io.vertx.core.impl.CloseHooks this
        start local 1 // io.vertx.core.Handler completionHandler
         0: .line 72
            aconst_null
            astore 2 /* copy */
        start local 2 // java.util.Set copy
         1: .line 73
            aload 0 /* this */
            dup
            astore 3
            monitorenter
         2: .line 74
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.closeHooksRun:Z
            ifeq 4
         3: .line 76
            new java.lang.IllegalStateException
            dup
            ldc "Close hooks already run"
            invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
            athrow
         4: .line 78
      StackMap locals: java.util.Set io.vertx.core.impl.CloseHooks
      StackMap stack:
            aload 0 /* this */
            iconst_1
            putfield io.vertx.core.impl.CloseHooks.closeHooksRun:Z
         5: .line 79
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.closeHooks:Ljava/util/Set;
            ifnull 7
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.closeHooks:Ljava/util/Set;
            invokeinterface java.util.Set.isEmpty:()Z
            ifne 7
         6: .line 81
            new java.util.HashSet
            dup
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.closeHooks:Ljava/util/Set;
            invokespecial java.util.HashSet.<init>:(Ljava/util/Collection;)V
            astore 2 /* copy */
         7: .line 73
      StackMap locals:
      StackMap stack:
            aload 3
            monitorexit
         8: goto 11
      StackMap locals:
      StackMap stack: java.lang.Throwable
         9: aload 3
            monitorexit
        10: athrow
        11: .line 84
      StackMap locals:
      StackMap stack:
            aload 2 /* copy */
            ifnull 29
            aload 2 /* copy */
            invokeinterface java.util.Set.isEmpty:()Z
            ifne 29
        12: .line 85
            aload 2 /* copy */
            invokeinterface java.util.Set.size:()I
            istore 3 /* num */
        start local 3 // int num
        13: .line 86
            iload 3 /* num */
            ifeq 27
        14: .line 87
            new java.util.concurrent.atomic.AtomicInteger
            dup
            invokespecial java.util.concurrent.atomic.AtomicInteger.<init>:()V
            astore 4 /* count */
        start local 4 // java.util.concurrent.atomic.AtomicInteger count
        15: .line 88
            new java.util.concurrent.atomic.AtomicBoolean
            dup
            invokespecial java.util.concurrent.atomic.AtomicBoolean.<init>:()V
            astore 5 /* failed */
        start local 5 // java.util.concurrent.atomic.AtomicBoolean failed
        16: .line 89
            aload 2 /* copy */
            invokeinterface java.util.Set.iterator:()Ljava/util/Iterator;
            astore 7
            goto 25
      StackMap locals: io.vertx.core.impl.CloseHooks io.vertx.core.Handler java.util.Set int java.util.concurrent.atomic.AtomicInteger java.util.concurrent.atomic.AtomicBoolean top java.util.Iterator
      StackMap stack:
        17: aload 7
            invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
            checkcast io.vertx.core.Closeable
            astore 6 /* hook */
        start local 6 // io.vertx.core.Closeable hook
        18: .line 90
            invokestatic io.vertx.core.Promise.promise:()Lio/vertx/core/Promise;
            astore 8 /* promise */
        start local 8 // io.vertx.core.Promise promise
        19: .line 91
            aload 8 /* promise */
            invokeinterface io.vertx.core.Promise.future:()Lio/vertx/core/Future;
            aload 5 /* failed */
            aload 1 /* completionHandler */
            aload 4 /* count */
            iload 3 /* num */
            invokedynamic handle(Ljava/util/concurrent/atomic/AtomicBoolean;Lio/vertx/core/Handler;Ljava/util/concurrent/atomic/AtomicInteger;I)Lio/vertx/core/Handler;
              Bootstrap: invokestatic java.lang.invoke.LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
                Method arguments:
                  (Ljava/lang/Object;)V
                  io/vertx/core/impl/CloseHooks.lambda$0(Ljava/util/concurrent/atomic/AtomicBoolean;Lio/vertx/core/Handler;Ljava/util/concurrent/atomic/AtomicInteger;ILio/vertx/core/AsyncResult;)V (6)
                  (Lio/vertx/core/AsyncResult;)V
            invokeinterface io.vertx.core.Future.setHandler:(Lio/vertx/core/Handler;)Lio/vertx/core/Future;
            pop
        20: .line 105
            aload 6 /* hook */
            aload 8 /* promise */
            invokeinterface io.vertx.core.Closeable.close:(Lio/vertx/core/Handler;)V
        21: .line 106
            goto 25
      StackMap locals: io.vertx.core.impl.CloseHooks io.vertx.core.Handler java.util.Set int java.util.concurrent.atomic.AtomicInteger java.util.concurrent.atomic.AtomicBoolean io.vertx.core.Closeable java.util.Iterator io.vertx.core.Promise
      StackMap stack: java.lang.Throwable
        22: astore 9 /* t */
        start local 9 // java.lang.Throwable t
        23: .line 107
            aload 0 /* this */
            getfield io.vertx.core.impl.CloseHooks.log:Lio/vertx/core/logging/Logger;
            ldc "Failed to run close hooks"
            aload 9 /* t */
            invokevirtual io.vertx.core.logging.Logger.warn:(Ljava/lang/Object;Ljava/lang/Throwable;)V
        24: .line 108
            aload 8 /* promise */
            aload 9 /* t */
            invokeinterface io.vertx.core.Promise.tryFail:(Ljava/lang/Throwable;)Z
            pop
        end local 9 // java.lang.Throwable t
        end local 8 // io.vertx.core.Promise promise
        end local 6 // io.vertx.core.Closeable hook
        25: .line 89
      StackMap locals: io.vertx.core.impl.CloseHooks io.vertx.core.Handler java.util.Set int java.util.concurrent.atomic.AtomicInteger java.util.concurrent.atomic.AtomicBoolean top java.util.Iterator
      StackMap stack:
            aload 7
            invokeinterface java.util.Iterator.hasNext:()Z
            ifne 17
        end local 5 // java.util.concurrent.atomic.AtomicBoolean failed
        end local 4 // java.util.concurrent.atomic.AtomicInteger count
        26: .line 111
            goto 30
        27: .line 112
      StackMap locals: io.vertx.core.impl.CloseHooks io.vertx.core.Handler java.util.Set int
      StackMap stack:
            aload 1 /* completionHandler */
            invokestatic io.vertx.core.Future.succeededFuture:()Lio/vertx/core/Future;
            invokeinterface io.vertx.core.Handler.handle:(Ljava/lang/Object;)V
        end local 3 // int num
        28: .line 114
            goto 30
        29: .line 115
      StackMap locals:
      StackMap stack:
            aload 1 /* completionHandler */
            invokestatic io.vertx.core.Future.succeededFuture:()Lio/vertx/core/Future;
            invokeinterface io.vertx.core.Handler.handle:(Ljava/lang/Object;)V
        30: .line 117
      StackMap locals:
      StackMap stack:
            return
        end local 2 // java.util.Set copy
        end local 1 // io.vertx.core.Handler completionHandler
        end local 0 // io.vertx.core.impl.CloseHooks this
      LocalVariableTable:
        Start  End  Slot               Name  Signature
            0   31     0               this  Lio/vertx/core/impl/CloseHooks;
            0   31     1  completionHandler  Lio/vertx/core/Handler<Lio/vertx/core/AsyncResult<Ljava/lang/Void;>;>;
            1   31     2               copy  Ljava/util/Set<Lio/vertx/core/Closeable;>;
           13   28     3                num  I
           15   26     4              count  Ljava/util/concurrent/atomic/AtomicInteger;
           16   26     5             failed  Ljava/util/concurrent/atomic/AtomicBoolean;
           18   25     6               hook  Lio/vertx/core/Closeable;
           19   25     8            promise  Lio/vertx/core/Promise<Ljava/lang/Void;>;
           23   25     9                  t  Ljava/lang/Throwable;
      Exception table:
        from    to  target  type
           2     8       9  any
           9    10       9  any
          20    21      22  Class java.lang.Throwable
    Signature: (Lio/vertx/core/Handler<Lio/vertx/core/AsyncResult<Ljava/lang/Void;>;>;)V
    MethodParameters:
                   Name  Flags
      completionHandler  

  private static void lambda$0(java.util.concurrent.atomic.AtomicBoolean, io.vertx.core.Handler, java.util.concurrent.atomic.AtomicInteger, int, io.vertx.core.AsyncResult);
    descriptor: (Ljava/util/concurrent/atomic/AtomicBoolean;Lio/vertx/core/Handler;Ljava/util/concurrent/atomic/AtomicInteger;ILio/vertx/core/AsyncResult;)V
    flags: (0x100a) ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC
    Code:
      stack=3, locals=5, args_size=5
        start local 4 // io.vertx.core.AsyncResult ar
         0: .line 92
            aload 4 /* ar */
            invokeinterface io.vertx.core.AsyncResult.failed:()Z
            ifeq 4
         1: .line 93
            aload 0
            iconst_0
            iconst_1
            invokevirtual java.util.concurrent.atomic.AtomicBoolean.compareAndSet:(ZZ)Z
            ifeq 6
         2: .line 95
            aload 1
            aload 4 /* ar */
            invokeinterface io.vertx.core.AsyncResult.cause:()Ljava/lang/Throwable;
            invokestatic io.vertx.core.Future.failedFuture:(Ljava/lang/Throwable;)Lio/vertx/core/Future;
            invokeinterface io.vertx.core.Handler.handle:(Ljava/lang/Object;)V
         3: .line 97
            goto 6
         4: .line 98
      StackMap locals:
      StackMap stack:
            aload 2
            invokevirtual java.util.concurrent.atomic.AtomicInteger.incrementAndGet:()I
            iload 3
            if_icmpne 6
         5: .line 100
            aload 1
            invokestatic io.vertx.core.Future.succeededFuture:()Lio/vertx/core/Future;
            invokeinterface io.vertx.core.Handler.handle:(Ljava/lang/Object;)V
         6: .line 103
      StackMap locals:
      StackMap stack:
            return
        end local 4 // io.vertx.core.AsyncResult ar
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    7     4    ar  Lio/vertx/core/AsyncResult<Ljava/lang/Void;>;
}
SourceFile: "CloseHooks.java"
InnerClasses:
  public final Lookup = java.lang.invoke.MethodHandles$Lookup of java.lang.invoke.MethodHandles