mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-30 02:37:31 +02:00
Merge pull request #780 from david-cermak/fix/mdns_task_delete_race
[mdns]: Fix potential task delete race
This commit is contained in:
@ -166,6 +166,8 @@ void vTaskDelete(TaskHandle_t *task)
|
|||||||
|
|
||||||
if (task == NULL) {
|
if (task == NULL) {
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
|
} else {
|
||||||
|
pthread_cancel((pthread_t)task);
|
||||||
}
|
}
|
||||||
void *thread_rval = NULL;
|
void *thread_rval = NULL;
|
||||||
pthread_join((pthread_t)task, &thread_rval);
|
pthread_join((pthread_t)task, &thread_rval);
|
||||||
|
@ -3,6 +3,6 @@ commitizen:
|
|||||||
bump_message: 'bump(mdns): $current_version -> $new_version'
|
bump_message: 'bump(mdns): $current_version -> $new_version'
|
||||||
pre_bump_hooks: python ../../ci/changelog.py mdns
|
pre_bump_hooks: python ../../ci/changelog.py mdns
|
||||||
tag_format: mdns-v$version
|
tag_format: mdns-v$version
|
||||||
version: 1.8.0
|
version: 1.8.1
|
||||||
version_files:
|
version_files:
|
||||||
- idf_component.yml
|
- idf_component.yml
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.8.1](https://github.com/espressif/esp-protocols/commits/mdns-v1.8.1)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Fix potential task delete race ([8ca45f34](https://github.com/espressif/esp-protocols/commit/8ca45f34))
|
||||||
|
|
||||||
## [1.8.0](https://github.com/espressif/esp-protocols/commits/mdns-v1.8.0)
|
## [1.8.0](https://github.com/espressif/esp-protocols/commits/mdns-v1.8.0)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
version: "1.8.0"
|
version: "1.8.1"
|
||||||
description: "Multicast UDP service used to provide local network service and host discovery."
|
description: "Multicast UDP service used to provide local network service and host discovery."
|
||||||
url: "https://github.com/espressif/esp-protocols/tree/master/components/mdns"
|
url: "https://github.com/espressif/esp-protocols/tree/master/components/mdns"
|
||||||
issues: "https://github.com/espressif/esp-protocols/issues"
|
issues: "https://github.com/espressif/esp-protocols/issues"
|
||||||
|
@ -5427,7 +5427,7 @@ static void _mdns_service_task(void *pvParameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_mdns_service_task_handle = NULL;
|
_mdns_service_task_handle = NULL;
|
||||||
vTaskDelete(NULL);
|
vTaskDelay(portMAX_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _mdns_timer_cb(void *arg)
|
static void _mdns_timer_cb(void *arg)
|
||||||
@ -5532,16 +5532,17 @@ static esp_err_t _mdns_service_task_stop(void)
|
|||||||
{
|
{
|
||||||
_mdns_stop_timer();
|
_mdns_stop_timer();
|
||||||
if (_mdns_service_task_handle) {
|
if (_mdns_service_task_handle) {
|
||||||
|
TaskHandle_t task_handle = _mdns_service_task_handle;
|
||||||
mdns_action_t action;
|
mdns_action_t action;
|
||||||
mdns_action_t *a = &action;
|
mdns_action_t *a = &action;
|
||||||
action.type = ACTION_TASK_STOP;
|
action.type = ACTION_TASK_STOP;
|
||||||
if (xQueueSend(_mdns_server->action_queue, &a, (TickType_t)0) != pdPASS) {
|
if (xQueueSend(_mdns_server->action_queue, &a, (TickType_t)0) != pdPASS) {
|
||||||
vTaskDelete(_mdns_service_task_handle);
|
|
||||||
_mdns_service_task_handle = NULL;
|
_mdns_service_task_handle = NULL;
|
||||||
}
|
}
|
||||||
while (_mdns_service_task_handle) {
|
while (_mdns_service_task_handle) {
|
||||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
|
vTaskDelete(task_handle);
|
||||||
}
|
}
|
||||||
vSemaphoreDelete(_mdns_service_semaphore);
|
vSemaphoreDelete(_mdns_service_semaphore);
|
||||||
_mdns_service_semaphore = NULL;
|
_mdns_service_semaphore = NULL;
|
||||||
|
Reference in New Issue
Block a user