diff --git a/NEsper/NEsper/core/service/EPRuntimeImpl.cs b/NEsper/NEsper/core/service/EPRuntimeImpl.cs index 2ad4f854b..ea1c6b35e 100644 --- a/NEsper/NEsper/core/service/EPRuntimeImpl.cs +++ b/NEsper/NEsper/core/service/EPRuntimeImpl.cs @@ -74,9 +74,6 @@ public class EPRuntimeImpl private IThreadLocal _threadLocalData; - [ThreadStatic] - private static Pair MetaLast; - #region Nested type: ThreadLocalData /// @@ -103,22 +100,7 @@ private ThreadLocalData ThreadData { get { -#if false return _threadLocalData.GetOrCreate(); -#else - if (MetaLast == null) - { - return (MetaLast = new Pair(this, _threadLocalData.GetOrCreate())).Second; - } - else if (MetaLast.First == this) - { - return MetaLast.Second; - } - else - { - return MetaLast.Second = _threadLocalData.GetOrCreate(); - } -#endif } } diff --git a/NEsper/NEsper/core/service/StatementResultServiceImpl.cs b/NEsper/NEsper/core/service/StatementResultServiceImpl.cs index 57c89300d..8006acb14 100644 --- a/NEsper/NEsper/core/service/StatementResultServiceImpl.cs +++ b/NEsper/NEsper/core/service/StatementResultServiceImpl.cs @@ -70,9 +70,6 @@ public class StatementResultServiceImpl : StatementResultService private IThreadLocal>> _lastResults = ThreadLocalManager.Create(() => new LinkedList>()); - [ThreadStatic] - private static Pair>> MetaLastResults; - /// /// Ctor. /// @@ -213,28 +210,6 @@ public void SetUpdateListeners(EPStatementListenerSet updateListeners, bool isRe #if NET45 //[MethodImplOptions.AggressiveInlining] #endif - private LinkedList> MetaLast() - { -#if false - return _lastResults.GetOrCreate(); -#else - if (MetaLastResults == null) - { - LinkedList> metaLast; - MetaLastResults = new Pair>>( - this, metaLast = _lastResults.GetOrCreate()); - return metaLast; - } - else if (MetaLastResults.First == this) - { - return MetaLastResults.Second; - } - else - { - return MetaLastResults.Second = _lastResults.GetOrCreate(); - } -#endif - } // Called by OutputProcessView public void Indicate(UniformPair results) @@ -248,7 +223,7 @@ public void Indicate(UniformPair results) _metricReportingService.AccountOutput(_statementMetricHandle, numIStream, numRStream); } - var lastResults = MetaLast(); + var lastResults = _lastResults.GetOrCreate(); if ((results.First != null) && (results.First.Length != 0)) { @@ -263,7 +238,7 @@ public void Indicate(UniformPair results) public void Execute() { - var dispatches = MetaLast(); + var dispatches = _lastResults.GetOrCreate(); var events = EventBeanUtility.FlattenList(dispatches); if (_isDebugEnabled) @@ -462,7 +437,7 @@ private void DispatchInternal(UniformPair events) /// public void DispatchOnStop() { - var dispatches = MetaLast(); + var dispatches = _lastResults.GetOrCreate(); if (dispatches.IsEmpty()) { return; @@ -472,7 +447,6 @@ public void DispatchOnStop() _lastResults = ThreadLocalManager.Create( () => new LinkedList>()); - MetaLastResults = null; } } }