Skip to content

Commit c23becf

Browse files
committed
Merge pull request #106 from nayato/pipeline
Syncing core channel pipeline elements up to date.
2 parents 49308fb + ab72d4a commit c23becf

20 files changed

Lines changed: 850 additions & 1002 deletions

src/DotNetty.Common/Concurrency/IPausableEventExecutor.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/DotNetty.Common/Concurrency/SingleThreadEventExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class SingleThreadEventExecutor : AbstractScheduledEventExecutor
3131
volatile int executionState = ST_NOT_STARTED;
3232
readonly PreciseTimeSpan preciseBreakoutInterval;
3333
PreciseTimeSpan lastExecutionTime;
34-
readonly ManualResetEventSlim emptyEvent = new ManualResetEventSlim();
34+
readonly ManualResetEventSlim emptyEvent = new ManualResetEventSlim(false, 1);
3535
readonly TaskScheduler scheduler;
3636
readonly TaskCompletionSource terminationCompletionSource;
3737
PreciseTimeSpan gracefulShutdownStartTime;

src/DotNetty.Common/DotNetty.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@
167167
<Compile Include="Internal\IQueue.cs" />
168168
<Compile Include="Internal\ConcurrentCircularArrayQueue.cs" />
169169
<Compile Include="Internal\MpscArrayQueue.cs" />
170+
<Compile Include="Internal\OneTimeTask.cs" />
170171
<Compile Include="Internal\PlatformDependent.cs" />
171172
<Compile Include="Properties\Friends.cs" />
172173
<Compile Include="Concurrency\AbstractEventExecutor.cs" />
173174
<Compile Include="Concurrency\AbstractScheduledEventExecutor.cs" />
174175
<Compile Include="Concurrency\ExecutorTaskScheduler.cs" />
175176
<Compile Include="Concurrency\IEventExecutor.cs" />
176-
<Compile Include="Concurrency\IPausableEventExecutor.cs" />
177177
<Compile Include="Concurrency\IRunnable.cs" />
178178
<Compile Include="Concurrency\IWrappedEventExecutor.cs" />
179179
<Compile Include="Concurrency\SingleThreadEventExecutor.cs" />
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
namespace DotNetty.Common.Internal
5+
{
6+
using DotNetty.Common.Concurrency;
7+
using DotNetty.Common.Utilities;
8+
9+
/// <summary>
10+
/// <see cref="IRunnable" /> which represent a one time task which may allow the <see cref="IEventExecutor" /> to
11+
/// reduce the amount of
12+
/// produced garbage when queue it for execution.
13+
/// <strong>It is important this will not be reused. After submitted it is not allowed to get submitted again!</strong>
14+
/// </summary>
15+
public abstract class OneTimeTask : MpscLinkedQueueNode<IRunnable>, IRunnable
16+
{
17+
public override IRunnable Value => this;
18+
19+
public abstract void Run();
20+
}
21+
}

src/DotNetty.Common/ResourceLeakDetector.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ static ResourceLeakDetector()
8686
/// </summary>
8787
public static DetectionLevel Level { get; set; }
8888

89+
/// Returns <c>true</c> if resource leak detection is enabled.
90+
public static bool Enabled => Level > DetectionLevel.Disabled;
91+
8992
readonly ConcurrentDictionary<string, bool> reportedLeaks = new ConcurrentDictionary<string, bool>();
9093

9194
readonly string resourceType;

0 commit comments

Comments
 (0)