@Override
    public int size() {
        return writeIndex - readIndex;
    }
The lock is used to ensure the resize operation and the drain operation won't happen
simultaneously.
turms-server-common/src/main/java/im/turms/server/common/infra/collection/SpscGrowableLongRingBuffer.java