diff --git a/Source/MQTTnet/Internal/AsyncLock.cs b/Source/MQTTnet/Internal/AsyncLock.cs index 9b7eefd..17d7404 100644 --- a/Source/MQTTnet/Internal/AsyncLock.cs +++ b/Source/MQTTnet/Internal/AsyncLock.cs @@ -23,7 +23,7 @@ namespace MQTTnet.Internal public Task WaitAsync(CancellationToken cancellationToken) { var task = _semaphore.WaitAsync(cancellationToken); - if (task.IsCompleted) + if (task.Status == TaskStatus.RanToCompletion) { return _releaser; }