fun createLatch()

in agent-sdk/src/main/java/co/elastic/otel/android/internal/features/exportergate/ExporterGateQueue.kt [46:56]


    fun createLatch(holder: Class<*>, name: String) {
        if (started.get()) {
            throw IllegalStateException()
        }
        open.compareAndSet(true, false)
        val latch = Latch(gateName, name)
        if (openLatches.put(holder, latch) != null) {
            throw IllegalStateException()
        }
        pendingLatches.incrementAndGet()
    }