threads: fix int as pointer warning for pthread_exit

clang-tidy:
        warning: integer to pointer cast pessimizes optimization opportunities

Since the returned code of -1 was never read, just return NULL.
pull/12565/head
Victor Julien 1 year ago
parent 3d46c18474
commit d545b4d860

@ -251,7 +251,7 @@ static void *TmThreadsSlotPktAcqLoop(void *td)
" tmqh_out=%p",
s, s ? s->PktAcqLoop : NULL, tv->tmqh_in, tv->tmqh_out);
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
@ -280,7 +280,7 @@ static void *TmThreadsSlotPktAcqLoop(void *td)
tv->flow_queue = FlowQueueNew();
if (tv->flow_queue == NULL) {
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
/* setup a queue */
@ -295,7 +295,7 @@ static void *TmThreadsSlotPktAcqLoop(void *td)
tv->flow_queue = FlowQueueNew();
if (tv->flow_queue == NULL) {
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
}
@ -354,7 +354,7 @@ static void *TmThreadsSlotPktAcqLoop(void *td)
error:
tv->stream_pq = NULL;
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
@ -400,7 +400,7 @@ static void *TmThreadsSlotVar(void *td)
/* check if we are setup properly */
if (s == NULL || tv->tmqh_in == NULL || tv->tmqh_out == NULL) {
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
@ -426,7 +426,7 @@ static void *TmThreadsSlotVar(void *td)
tv->flow_queue = FlowQueueNew();
if (tv->flow_queue == NULL) {
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
/* setup a queue */
@ -441,7 +441,7 @@ static void *TmThreadsSlotVar(void *td)
tv->flow_queue = FlowQueueNew();
if (tv->flow_queue == NULL) {
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
}
@ -524,7 +524,7 @@ static void *TmThreadsSlotVar(void *td)
error:
tv->stream_pq = NULL;
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
@ -551,7 +551,7 @@ static void *TmThreadsManagement(void *td)
r = s->SlotThreadInit(tv, s->slot_initdata, &slot_data);
if (r != TM_ECODE_OK) {
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
(void)SC_ATOMIC_SET(s->slot_data, slot_data);
@ -582,7 +582,7 @@ static void *TmThreadsManagement(void *td)
r = s->SlotThreadDeinit(tv, SC_ATOMIC_GET(s->slot_data));
if (r != TM_ECODE_OK) {
TmThreadsSetFlag(tv, THV_CLOSED);
pthread_exit((void *) -1);
pthread_exit(NULL);
return NULL;
}
}

Loading…
Cancel
Save