terminate correctly statically created tasks

This commit is contained in:
philippe44
2019-11-05 20:18:26 -08:00
parent 3304571312
commit 0f8bd30544
5 changed files with 13 additions and 17 deletions

View File

@@ -305,6 +305,7 @@ void rtp_end(rtp_t *ctx)
ctx->running = false;
#ifdef WIN32
pthread_join(ctx->thread, NULL);
#else
xTaskNotifyWait(0, 0, NULL, portMAX_DELAY);
vTaskDelete(ctx->thread);
free(ctx->xStack);
@@ -709,7 +710,7 @@ static void *rtp_thread_func(void *arg) {
free(packet);
LOG_INFO("[%p]: terminating", ctx);
#ifndef WIN32
xTaskNotify(ctx->joiner, 0, eNoAction);
vTaskSuspend(NULL);