mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-13 07:26:52 +01:00
Lock critical section when adding new Client to list
Signed-off-by: Mariusz Suchora <mariusz.suchora@tieto.com>
This commit is contained in:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user