ConcurrentPublication addPublication(final String channel, final int streamId)
    {
        clientLock.lock();
        try
        {
            ensureActive();
            ensureNotReentrant();

            final long registrationId = driverProxy.addPublication(channel, streamId);
            stashedChannelByRegistrationId.put(registrationId, channel);
            awaitResponse(registrationId);

            return (ConcurrentPublication)resourceByRegIdMap.get(registrationId);
        }
        finally
        {
            clientLock.unlock();
        }
    }
@Test
    void shouldNotPreTouchLogBuffersForPublicationIfDisabled()
    {
        final int streamId = -53453894;
        final String channel = "aeron:ipc?alias=test";
        final long publicationId = 113;
        final String logFileName = SESSION_ID_2 + "-log";
        context.preTouchMappedMemory(false);

        whenReceiveBroadcastOnMessage(
            ControlProtocolEvents.ON_PUBLICATION_READY,
            publicationReadyBuffer,
            (buffer) ->
            {
                publicationReady.correlationId(publicationId);
                publicationReady.registrationId(publicationId);
                publicationReady.logFileName(logFileName);
                return publicationReady.length();
            });
        when(driverProxy.addPublication(channel, streamId)).thenReturn(publicationId);
        final ConcurrentPublication publication = conductor.addPublication(channel, streamId);
        assertNotNull(publication);

        final LogBuffers logBuffers = logBuffersFactory.map(logFileName);
        assertNotNull(logBuffers);
        verify(logBuffers, never()).preTouch();
    }