repair a bug of restart main after ota

This commit is contained in:
Wang_Weigen 2021-11-30 10:12:42 +08:00
parent 1c60efe8a8
commit ac69e135ca
1 changed files with 2 additions and 1 deletions

View File

@ -178,10 +178,11 @@ static void RestartApplication(void)
while(1) while(1)
{ {
unsigned long pid = PrivUserTaskSearch(); unsigned long pid = PrivUserTaskSearch();
if (pid > 0) if ((pid > 0) && (pid != pthread_self()))
{ {
printf("kill usertask pid[%d]\n",pid); printf("kill usertask pid[%d]\n",pid);
PrivTaskDelete(pid, 0); PrivTaskDelete(pid, 0);
PrivTaskDelay(1000);
} }
else else
{ {