Here it is, the new thread interface.
[citadel.git] / citadel / include / ctdl_module.h
index 51d5c9c7f88f537c55943b94fdafcf4c8b345e43..587adb4a81f007816e9f4e95f36501ef2da720fc 100644 (file)
@@ -11,9 +11,9 @@
  * define macros for module init stuff
  */
  
-#define CTDL_MODULE_INIT(module_name) char *ctdl_module_##module_name##_init (void)
+#define CTDL_MODULE_INIT(module_name) char *ctdl_module_##module_name##_init (int threading)
 
-#define CTDL_INIT_CALL(module_name) ctdl_module_##module_name##_init ()
+#define CTDL_INIT_CALL(module_name) ctdl_module_##module_name##_init (threading)
 
 
 /*
@@ -104,4 +104,19 @@ int CtdlDoDirectoryServiceFunc(char *cn, char *ou, void **object, char *module,
  */
 void CtdlModuleStartCryptoMsgs(char *ok_response, char *nosup_response, char *error_response);
 
+
+/*
+ * Citadel Threads API
+ */
+struct CtdlThreadNode *CtdlThreadCreate(char *name, long flags, void *(*thread_func) (void *arg), void *args);
+void CtdlThreadSleep(int secs);
+void CtdlThreadStop(struct CtdlThreadNode *thread);
+int CtdlThreadCheckStop(void);
+void CtdlThreadCancel(struct CtdlThreadNode *thread);
+char *CtdlThreadName(struct CtdlThreadNode *thread, char *name);
+struct CtdlThreadNode *CtdlThreadSelf(void);
+int CtdlThreadGetCount(void);
+void CtdlThreadGC(void);
+void CtdlThreadStopAll(void);
+
 #endif /* CTDL_MODULE_H */