From 2af91e5aea51108af6c0d05fdf298f2863de2bb8 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 19 Apr 2023 11:09:26 +0200 Subject: [PATCH] implemented double pointers in stop_oldest_thread --- src/chat/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chat/misc.c b/src/chat/misc.c index c6a9220..7da33aa 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -264,8 +264,8 @@ void *stop_oldest_thread(void *id) { sleep(WHY2_COMMUNICATION_TIME); //yk wait if (waiting_list.head == NULL) return NULL; - - if (*(pthread_t*) waiting_list.head -> value == *(pthread_t*) id) //THREAD IS STILL ALIVE, I HOPE + printf("A\n"); + if (**(pthread_t**) waiting_list.head -> value == *(pthread_t*) id) //THREAD IS STILL ALIVE, I HOPE { //KILL THE THREAD pthread_cancel(*(pthread_t*) id);