implemented double pointers in stop_oldest_thread

This commit is contained in:
Václav Šmejkal 2023-04-19 11:09:26 +02:00
parent abb1805338
commit 2af91e5aea
Signed by: ENGO150
GPG Key ID: F6D6DF86242C5A59

View File

@ -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);