Index: trunk/include/samhain.h
===================================================================
--- trunk/include/samhain.h	(revision 140)
+++ trunk/include/samhain.h	(revision 143)
@@ -128,10 +128,8 @@
 };
 
-enum {
-  SH_MOD_ACTIVE    = 0, 
-  SH_MOD_THREAD    = 1,
-  SH_MOD_FAILED    = 2
-};
-
+#define SH_MOD_THREAD  1
+#define SH_MOD_ACTIVE  0
+#define SH_MOD_FAILED -1
+ 
 /* Flags for file status
  */
@@ -287,6 +285,7 @@
 extern volatile  int      sig_debug_switch;       /* SIGUSR1 */
 extern volatile  int      sig_suspend_switch;     /* SIGUSR2 */
-extern volatile  int      sh_global_suspend_flag; /* SIGUSR2 */
+extern volatile  int      sh_global_suspend_flag;
 extern volatile  int      sig_fresh_trail;        /* SIGIOT  */
+extern volatile  int      sh_thread_pause_flag;
 extern volatile  int      sig_config_read_again;  /* SIGHUP  */
 extern volatile  int      sig_terminate;          /* SIGQUIT */
Index: trunk/include/sh_pthread.h
===================================================================
--- trunk/include/sh_pthread.h	(revision 140)
+++ trunk/include/sh_pthread.h	(revision 143)
@@ -38,7 +38,4 @@
 #if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
 
-/* On GNU C, it's an enum, thus the alternative implementation 
- * below is used.
- */
 #define SH_MUTEX_RECURSIVE(M)                                          \
 static pthread_mutex_t M;                                              \
@@ -46,4 +43,5 @@
 {                                                                      \
   pthread_mutexattr_t   mta;                                           \
+  pthread_mutexattr_init(&mta);                                        \
   pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);            \
   pthread_mutex_init(&(M), &mta);                                      \
@@ -115,4 +113,6 @@
 SH_MUTEX_EXTERN(mutex_pwent);
 SH_MUTEX_EXTERN(mutex_readdir);
+/* Prevent threads from logging while we are in suspend */
+SH_MUTEX_EXTERN(mutex_thread_nolog);
 
 /*
@@ -120,4 +120,13 @@
  */
 extern int sh_g_thread();
+
+
+/*
+ * ----   Functions for threaded modules   ----
+ */
+int sh_pthread_create(void *(*start_routine)(void*), void *arg);
+int sh_pthread_cancel_all(void);
+void sh_threaded_module_reconf(void *arg);
+void * sh_threaded_module_run(void *arg);
 
 #else
