From 594db623ee2aaac47960f6f29acd2e71e35212d8 Mon Sep 17 00:00:00 2001 From: Mariusz Suchora Date: Fri, 23 Feb 2018 10:18:46 +0100 Subject: [PATCH] Lock critical section when adding new Client to list Signed-off-by: Mariusz Suchora --- MQTTSNGateway/src/MQTTSNGWClient.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MQTTSNGateway/src/MQTTSNGWClient.cpp b/MQTTSNGateway/src/MQTTSNGWClient.cpp index 9a8a043..f5ab22c 100644 --- a/MQTTSNGateway/src/MQTTSNGWClient.cpp +++ b/MQTTSNGateway/src/MQTTSNGWClient.cpp @@ -12,6 +12,7 @@ * * Contributors: * Tomoaki Yamaguchi - initial API and implementation and/or initial documentation + * Tieto Poland Sp. z o.o. - Gateway improvements **************************************************************************************/ #include "MQTTSNGWClient.h" @@ -236,6 +237,8 @@ Client* ClientList::createClient(SensorNetAddress* addr, MQTTSNString* clientId, free(dummyId.cstring); } + _mutex.lock(); + /* add the list */ if ( _firstClient == 0 ) {