From 1e2920603bef137be801585c4bbceddd60e47fdb Mon Sep 17 00:00:00 2001 From: goodale Date: Wed, 25 Oct 2000 22:47:51 +0000 Subject: Making sure http thread has finished before shutting down socket. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@97 1faa4e14-9dd3-4be0-9f0e-ffe519881164 --- src/Startup.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/Startup.c') diff --git a/src/Startup.c b/src/Startup.c index 3047242..b853dbb 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -180,7 +180,7 @@ void HTTP_Work(CCTK_ARGUMENTS) @date Wed Sep 13 21:26:56 2000 @author Tom Goodale @desc - Shurdown routine for the webserver. + Shutdown routine for the webserver. @enddesc @calls @calledby @@ -191,6 +191,14 @@ void HTTP_Work(CCTK_ARGUMENTS) @@*/ int HTTP_Shutdown(void) { + DECLARE_CCTK_PARAMETERS +#ifdef PTHREADS + /* Wait for the polling thread to exit */ + if(CCTK_MyProc(NULL) == 0 && use_pthreads && thread_started) + { + pthread_join(polling_thread, NULL); + } +#endif if(CCTK_MyProc(NULL) == 0) { -- cgit v1.2.3