public void enter() {
        if (lock.isLocked()) {
            lock.lock();
            lock.unlock();
        }
        counter.incrementAndGet();
    }
Thread Barrier used to avoid concurrency issues during event processing
modules/siddhi-core/src/main/java/io/siddhi/core/util/ThreadBarrier.java