mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-31 03:08:03 +02:00
fix deadlock between xEventGroupWaitBits and API lock semaphore
Merges https://github.com/espressif/esp-mqtt/pull/124 Closes https://github.com/espressif/esp-mqtt/issues/122
This commit is contained in:
committed by
David Cermak
parent
2fef1a07c5
commit
cbae6343e9
@ -1168,9 +1168,9 @@ esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
client->run = false;
|
client->run = false;
|
||||||
xEventGroupWaitBits(client->status_bits, STOPPED_BIT, false, true, portMAX_DELAY);
|
|
||||||
client->state = MQTT_STATE_UNKNOWN;
|
client->state = MQTT_STATE_UNKNOWN;
|
||||||
MQTT_API_UNLOCK_FROM_OTHER_TASK(client);
|
MQTT_API_UNLOCK_FROM_OTHER_TASK(client);
|
||||||
|
xEventGroupWaitBits(client->status_bits, STOPPED_BIT, false, true, portMAX_DELAY);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGW(TAG, "Client asked to stop, but was not started");
|
ESP_LOGW(TAG, "Client asked to stop, but was not started");
|
||||||
|
Reference in New Issue
Block a user