diff options
author | goodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2000-10-25 22:47:51 +0000 |
---|---|---|
committer | goodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2000-10-25 22:47:51 +0000 |
commit | 1e2920603bef137be801585c4bbceddd60e47fdb (patch) | |
tree | a37bb05b414c7506799474613ba111867759f563 | |
parent | 67e78d93e56222ee7b8b7e95e66d87f4cc5452f6 (diff) |
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
-rw-r--r-- | src/Startup.c | 10 |
1 files changed, 9 insertions, 1 deletions
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) { |