bindings/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java [466:503]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private Object getOrCreateMutex(Continuation continuation) {
        Object result = null;

        // let's try to find the object that corresponds to the exchange first
        if (continuation != null) {
            result = continuation.getAttribute(MUTEX);
        }

        // no luck finding an existing object, let's create a new one
        if (result == null) {
            result = new Object();
        }

        return result;
    }

    private MessageExchange doClean(Object mutex, Continuation continuation, String exchangeId) {
        if (mutex != null) {
            synchronized (mutex) {
                if (exchangeId == null && continuation != null) {
                    exchangeId = (String) continuation.getAttribute(EXCHANGEID);
                }
                if (exchangeId != null && continuation == null) {
                    continuation = continuations.remove(exchangeId);
                }
                if (continuation != null) {
                    continuation.removeAttribute(EXCHANGEID);
                    continuation.removeAttribute(EXCHANGE);
                    continuation.removeAttribute(MUTEX);
                }
                if (exchangeId != null) {
                    mutexes.remove(exchangeId);
                    continuations.remove(exchangeId);
                    return sentExchanges.remove(exchangeId);
                }
            }
        }
        return null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



bindings/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java [245:282]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private Object getOrCreateMutex(Continuation continuation) {
        Object result = null;

        // let's try to find the object that corresponds to the exchange first
        if (continuation != null) {
            result = continuation.getAttribute(MUTEX);
        }

        // no luck finding an existing object, let's create a new one
        if (result == null) {
            result = new Object();
        }

        return result;
    }

    private MessageExchange doClean(Object mutex, Continuation continuation, String exchangeId) {
        if (mutex != null) {
            synchronized (mutex) {
                if (exchangeId == null && continuation != null) {
                    exchangeId = (String) continuation.getAttribute(EXCHANGEID);
                }
                if (exchangeId != null && continuation == null) {
                    continuation = continuations.remove(exchangeId);
                }
                if (continuation != null) {
                    continuation.removeAttribute(EXCHANGEID);
                    continuation.removeAttribute(EXCHANGE);
                    continuation.removeAttribute(MUTEX);
                }
                if (exchangeId != null) {
                    mutexes.remove(exchangeId);
                    continuations.remove(exchangeId);
                    return sentExchanges.remove(exchangeId);
                }
            }
        }
        return null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



