From ee48214209e66aa8c6f353262b175895373f76df Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sat, 4 Jan 2020 21:31:55 +0100 Subject: ... --- src/server/communication_thread.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'src/server/communication_thread.c') diff --git a/src/server/communication_thread.c b/src/server/communication_thread.c index 2da54d2..e226f17 100644 --- a/src/server/communication_thread.c +++ b/src/server/communication_thread.c @@ -4,20 +4,24 @@ /**** RELABSD *****************************************************************/ #include +#include /******************************************************************************/ /**** LOCAL FUNCTIONS *********************************************************/ /******************************************************************************/ +/* TODO: implement. */ +/* void main_loop (struct relabsd_server server [const static 1]) { - } +*/ void * posix_main_loop (void * params) { - main_loop((struct relabsd_server *) params); + /* main_loop((struct relabsd_server *) params);*/ + params = NULL; - return NULL; + return params; } /******************************************************************************/ @@ -52,3 +56,26 @@ int relabsd_server_create_communication_thread return 0; } + +int relabsd_server_join_communication_thread +( + struct relabsd_server server [const static 1] +) +{ + int err; + + err = pthread_join(server->communication_thread, (void **) NULL); + + if (err != 0) + { + RELABSD_FATAL + ( + "Unable to join with the communication thread: %s", + strerror(err) + ); + + return -1; + } + + return 0; +} -- cgit v1.2.3-70-g09d2