defined why2_clean_threads

meow
This commit is contained in:
Václav Šmejkal 2023-02-22 10:16:01 +01:00
parent 2b790a21fe
commit 459329e0d0
Signed by: ENGO150
GPG Key ID: F6D6DF86242C5A59

View File

@ -212,3 +212,19 @@ void *why2_accept_thread(void *socket)
pthread_create(&thread, NULL, why2_communicate_thread, &connection_buffer); pthread_create(&thread, NULL, why2_communicate_thread, &connection_buffer);
} }
} }
void why2_clean_threads(void)
{
if (head == NULL) return; //EMPTY LIST
node_t *node_buffer = head;
node_t *node_buffer_2;
while (node_buffer -> next != NULL) //GO TROUGH LIST
{
node_buffer_2 = node_buffer;
node_buffer = node_buffer -> next;
remove_node(node_buffer_2); //REMOVE
}
}