typo: pthread_cleanup_push/pop better exist in pair

This commit is contained in:
freemine 2023-02-05 16:08:34 +08:00
parent 2a7732b159
commit a999e56a1d
2 changed files with 36 additions and 33 deletions

View File

@ -114,6 +114,7 @@ static void *taosProcessAlarmSignal(void *tharg) {
taosThreadCleanupPush(taosDeleteTimer, &timerId);
do {
struct itimerspec ts;
ts.it_value.tv_sec = 0;
ts.it_value.tv_nsec = 1000000 * MSECONDS_PER_TICK;
@ -122,7 +123,7 @@ static void *taosProcessAlarmSignal(void *tharg) {
if (timer_settime(timerId, 0, &ts, NULL)) {
// printf("Failed to init timer");
return NULL;
break;
}
int signo;
@ -132,9 +133,9 @@ static void *taosProcessAlarmSignal(void *tharg) {
continue;
}
/* //printf("Signal handling: number %d ......\n", signo); */
callback(0);
}
} while (0);
taosThreadCleanupPop(1);

View File

@ -1046,10 +1046,11 @@ void *shellThreadLoop(void *arg) {
taosGetOldTerminalMode();
taosThreadCleanupPush(shellCleanup, NULL);
do {
char *command = taosMemoryMalloc(SHELL_MAX_COMMAND_SIZE);
if (command == NULL) {
printf("failed to malloc command\r\n");
return NULL;
break;
}
do {
@ -1066,6 +1067,7 @@ void *shellThreadLoop(void *arg) {
taosMemoryFreeClear(command);
shellWriteHistory();
shellExit();
} while (0);
taosThreadCleanupPop(1);
return NULL;