Skip to content

Commit

Permalink
Fix TSAN report with WOLFMQTT_DEBUG_CLIENT set around the use of clie…
Browse files Browse the repository at this point in the history
…nt->lastRc used for debugging.
  • Loading branch information
dgarske committed Nov 21, 2023
1 parent ebd7bab commit 052656c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,8 +1381,16 @@ static int MqttClient_WaitType(MqttClient *client, void *packet_obj,

#ifdef WOLFMQTT_NONBLOCK
#ifdef WOLFMQTT_DEBUG_CLIENT
client->lastRc = rc;
#ifdef WOLFMQTT_MULTITHREAD
if (wm_SemLock(&client->lockClient) == 0)
#endif
{
client->lastRc = rc;
#ifdef WOLFMQTT_MULTITHREAD
wm_SemUnlock(&client->lockClient);
#endif
}
#endif /* WOLFMQTT_DEBUG_CLIENT */
if (rc == MQTT_CODE_CONTINUE) {
return rc;
}
Expand Down

0 comments on commit 052656c

Please sign in to comment.