private BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder) { if (_bufferedDataPool == null) { lock (ThisLock) { if (_bufferedDataPool == null) { //running = true; _bufferedDataPool = new SynchronizedPool<BinaryBufferedMessageData>(_maxReadPoolSize); } } } BinaryBufferedMessageData messageData = _bufferedDataPool.Take(); if (messageData == null) { messageData = new BinaryBufferedMessageData(this, maxPooledXmlReaderPerMessage); if (WcfEventSource.Instance.ReadPoolMissIsEnabled()) { WcfEventSource.Instance.ReadPoolMiss(messageData.GetType().Name); } } messageData.SetMessageEncoder(messageEncoder); return messageData; }
BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder) { if (bufferedDataPool == null) { lock (ThisLock) { if (bufferedDataPool == null) { //running = true; bufferedDataPool = new SynchronizedPool<BinaryBufferedMessageData>(maxReadPoolSize); } } } BinaryBufferedMessageData messageData = bufferedDataPool.Take(); if (messageData == null) { messageData = new BinaryBufferedMessageData(this, maxPooledXmlReaderPerMessage); if (TD.ReadPoolMissIsEnabled()) { TD.ReadPoolMiss(messageData.GetType().Name); } } messageData.SetMessageEncoder(messageEncoder); return messageData; }