implemented linked list in chat-server
This commit is contained in:
parent
3b85c5fc5a
commit
ad9f4b8f2d
@ -48,6 +48,7 @@ int main(void)
|
|||||||
if (accepted == -1) continue;
|
if (accepted == -1) continue;
|
||||||
|
|
||||||
pthread_create(&thread, NULL, why2_communicate_thread, &accepted);
|
pthread_create(&thread, NULL, why2_communicate_thread, &accepted);
|
||||||
|
why2_register_connection(accepted); //PUSH TO LIST
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -152,6 +152,7 @@ void *why2_communicate_thread(void *arg)
|
|||||||
printf("User exited.\t%d\n", *((int*) arg));
|
printf("User exited.\t%d\n", *((int*) arg));
|
||||||
|
|
||||||
//DEALLOCATION
|
//DEALLOCATION
|
||||||
|
remove_node(get_node(why2_communicate_thread));
|
||||||
close(*((int*) arg));
|
close(*((int*) arg));
|
||||||
why2_deallocate(received);
|
why2_deallocate(received);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user