Skip to content

Commit d4a6ef0

Browse files
authored
Fix Stop() which lacked a ConfigureAwait(). (#17)
1 parent 4813515 commit d4a6ef0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Winton.Extensions.Threading.Actor/Internal/ActorImpl.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ namespace Winton.Extensions.Threading.Actor.Internal
77
{
88
internal sealed class ActorImpl : IActor
99
{
10-
private readonly TaskCompletionSource<object> _stoppedPromise = new TaskCompletionSource<object>();
11-
1210
public ActorImpl(IActorTaskFactory actorTaskFactory)
1311
{
1412
Context = new ActorContext(actorTaskFactory);
@@ -26,17 +24,16 @@ public ActorStopWork StopWork
2624
set => Context.StopWork = value;
2725
}
2826

29-
public Task StoppedTask => _stoppedPromise.Task;
27+
public Task StoppedTask => Context.StopCompletionSource.Task;
3028

3129
public Task Start()
3230
{
3331
return Context.Start();
3432
}
3533

36-
public async Task Stop()
34+
public Task Stop()
3735
{
38-
await Context.Stop();
39-
_stoppedPromise.TrySetResult(null);
36+
return Context.Stop();
4037
}
4138

4239
public Task Enqueue(Action action, CancellationToken cancellationToken, ActorEnqueueOptions options)

0 commit comments

Comments
 (0)