]> code.citadel.org Git - citadel.git/blobdiff - citadel/include/ctdl_module.h
Added the functions to allow scheduling of a thread to start at some
[citadel.git] / citadel / include / ctdl_module.h
index 93fbf02125b73a5e893f5a554aa37fe4781bf39a..932e0fe387428c71341190cc6745174ca928014c 100644 (file)
@@ -113,11 +113,12 @@ void CtdlModuleStartCryptoMsgs(char *ok_response, char *nosup_response, char *er
  * Citadel Threads API
  */
 struct CtdlThreadNode *CtdlThreadCreate(char *name, long flags, void *(*thread_func) (void *arg), void *args);
+struct CtdlThreadNode *CtdlThreadSchedule(char *name, long flags, void *(*thread_func) (void *arg), void *args, time_t when);
 void CtdlThreadSleep(int secs);
 void CtdlThreadStop(struct CtdlThreadNode *thread);
-int CtdlThreadCheckStop(struct CtdlThreadNode *this_thread);
+int CtdlThreadCheckStop(void);
 void CtdlThreadCancel(struct CtdlThreadNode *thread);
-const char *CtdlThreadName(struct CtdlThreadNode *thread, const char *name);
+const char *CtdlThreadName(const char *name);
 struct CtdlThreadNode *CtdlThreadSelf(void);
 int CtdlThreadGetCount(void);
 int CtdlThreadGetWorkers(void);
@@ -126,11 +127,13 @@ double CtdlThreadGetLoadAvg(void);
 void CtdlThreadGC(void);
 void CtdlThreadStopAll(void);
 int CtdlThreadSelect(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout, struct CtdlThreadNode *self);
+void CtdlThreadAllocTSD(void);
 
 /* Macros to speed up getting outr thread */
-#define CT _this_cit_thread
-#define CT_PUSH() \
-       struct CtdlThreadNode *_this_cit_thread;\
-       _this_cit_thread = CtdlThreadSelf()
+
+#define MYCURSORS      (((ThreadTSD*)pthread_getspecific(ThreadKey))->cursors)
+#define MYTID          (((ThreadTSD*)pthread_getspecific(ThreadKey))->tid)
+#define CT             (((ThreadTSD*)pthread_getspecific(ThreadKey))->self)
+
 
 #endif /* CTDL_MODULE_H */