]> code.citadel.org Git - citadel.git/blobdiff - citadel/sysdep_decls.h
Begun implimentation of a really good thread control interface.
[citadel.git] / citadel / sysdep_decls.h
index 17cb5b63f132684463cc25b7856ebc411e39e60f..ab8745c790c5e0ee1073ddc3b0190c287d441bc9 100644 (file)
 
 
 #include <pthread.h>
+#include <stdarg.h>
 #include "sysdep.h"
 #include "server.h"
 
-#if SIZEOF_SIZE_T == SIZEOF_LONG
-#define SIZE_T_FMT "%ld"
-#else 
+#if SIZEOF_SIZE_T == SIZEOF_INT 
 #define SIZE_T_FMT "%d"
+#else
+#define SIZE_T_FMT "%ld"
 #endif
 
 
@@ -50,6 +51,8 @@ void lprintf (enum LogLevel loglevel, const char *format, ...);
 void cprintf (const char *format, ...);
 #endif
 
+void vlprintf (enum LogLevel loglevel, const char *format, va_list arg_ptr);
+
 extern pthread_key_t MyConKey;                 /* TSD key for MyContext() */
 
 extern int enable_syslog;
@@ -81,6 +84,8 @@ void InitializeMasterCC(void);
 void init_master_fdset(void);
 void create_worker(void);
 void InitialiseSemaphores(void);
+void ctdl_internal_thread_gc (int shutdown);
+
 
 extern int num_sessions;
 extern volatile int time_to_die;
@@ -96,6 +101,19 @@ extern struct worker_node {
         struct worker_node *next;
 } *worker_list;
 
+
+extern struct CtdlThreadNode {
+       pthread_t tid;
+       char *name;
+       void *(*thread_func) (void *arg);
+       void *user_args;
+       int flags;
+       int running;
+       int valid;
+       struct CtdlThreadNode *prev;
+       struct CtdlThreadNode *next;
+} *CtdlThreadList;
+
 extern int SyslogFacility(char *name);
 extern int syslog_facility;