mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-13 15:36:51 +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:
|
* Contributors:
|
||||||
* Tomoaki Yamaguchi - initial API and implementation and/or initial documentation
|
* Tomoaki Yamaguchi - initial API and implementation and/or initial documentation
|
||||||
|
* Tieto Poland Sp. z o.o. - Gateway improvements
|
||||||
**************************************************************************************/
|
**************************************************************************************/
|
||||||
|
|
||||||
#include "MQTTSNGWClient.h"
|
#include "MQTTSNGWClient.h"
|
||||||
@@ -236,6 +237,8 @@ Client* ClientList::createClient(SensorNetAddress* addr, MQTTSNString* clientId,
|
|||||||
free(dummyId.cstring);
|
free(dummyId.cstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_mutex.lock();
|
||||||
|
|
||||||
/* add the list */
|
/* add the list */
|
||||||
if ( _firstClient == 0 )
|
if ( _firstClient == 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user