Class AgentBuilder.CircularityLock.Default

    • Field Detail

      • threads

        private final java.util.concurrent.ConcurrentMap<java.lang.Thread,​java.lang.Boolean> threads
        A map of threads to an unused boolean to emulate a thread-local state without using thread locals. This avoids using thread-local maps and does not interfere with Java fibers in case that an instrumentation is executed from a virtual thread where thread locals are not permitted.
    • Constructor Detail

      • Default

        public Default()
    • Method Detail

      • acquire

        public boolean acquire()
        Attempts to acquire a circularity lock.
        Specified by:
        acquire in interface AgentBuilder.CircularityLock
        Returns:
        true if the lock was acquired successfully, false if it is already hold.
      • isLocked

        protected boolean isLocked()
        Returns true if the current thread is currently locked.
        Returns:
        true if the current thread is currently locked.