aboutsummaryrefslogtreecommitdiff
path: root/src/Startup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Startup.c')
-rw-r--r--src/Startup.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/Startup.c b/src/Startup.c
index 5c3034d..e288d95 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -8,22 +8,22 @@
@version $Header$
@@*/
+#include "cctk.h"
+
+#ifdef PTHREADS
+#include <pthread.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
-#include "cctk.h"
#include "cctk_Parameter.h"
-
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "httpd.h"
#include "http_Steer.h"
-#ifdef PTHREADS
-#include <pthread.h>
-#endif
-
static char *rcsid = "$Header$";
CCTK_FILEVERSION(CactusConnect_HTTPD_Startup_c)
@@ -36,8 +36,10 @@ CCTK_FILEVERSION(CactusConnect_HTTPD_Startup_c)
********************* Local Routine Prototypes *********************
********************************************************************/
+#ifdef PTHREADS
static void * HTTP_Thread(void *cctkGH);
static void HTTP_SetupPollingThread(cGH *cctkGH);
+#endif
/********************************************************************
***************** Scheduled Routine Prototypes *********************
@@ -242,6 +244,7 @@ int HTTP_Shutdown(void)
@endvar
@@*/
+#ifdef PTHREADS
static void * HTTP_Thread(void *cctkGH)
{
CCTK_INT *terminate;
@@ -282,15 +285,14 @@ static void * HTTP_Thread(void *cctkGH)
@@*/
static void HTTP_SetupPollingThread(cGH *cctkGH)
{
-#ifdef PTHREADS
if(pthread_create(&polling_thread, NULL, HTTP_Thread, (void *)cctkGH))
- {
+ {
perror("pthread_create: ");
CCTK_Exit(cctkGH,99);
}
else
- {
+ {
thread_started = 1;
}
-#endif
}
+#endif /* PTHREADS */