private void acquire() {
        final Thread thread = Thread.currentThread();
        final long threadId = thread.getId();
        if (threadId != currentThread.get() && !currentThread.compareAndSet(NO_CURRENT_THREAD, threadId))
            throw new ConcurrentModificationException("KafkaConsumer is not safe for multi-threaded access. " +
                    "currentThread(name: " + thread.getName() + ", id: " + threadId + ")" +
                    " otherThread(id: " + currentThread.get() + ")"
            );
        refcount.incrementAndGet();
    }
Acquire the light lock protecting this consumer from multi-threaded access. Instead of blocking
when the lock is not available, however, we just throw an exception (since multi-threaded usage is not
supported).
@throws ConcurrentModificationException if another thread already has the lock
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ClassicKafkaConsumer.java