From 483c2d8b10781867bbca9ba98c08d844818bca59 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 15 Nov 2020 14:21:11 +0100 Subject: [PATCH] Fix Unit Tests. --- Source/MQTTnet/Client/MqttClient.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/MQTTnet/Client/MqttClient.cs b/Source/MQTTnet/Client/MqttClient.cs index 4147bfc2..9fc54c0d 100644 --- a/Source/MQTTnet/Client/MqttClient.cs +++ b/Source/MQTTnet/Client/MqttClient.cs @@ -763,6 +763,8 @@ namespace MQTTnet.Client bool DisconnectIsPending() { + // This will read the _isDisconnectPending and set it to "1" afterwards regardless of the value. + // So the first caller will get a "false" and all subsequent ones will get "true". return Interlocked.CompareExchange(ref _isDisconnectPending, 1, 0) != 0; } }