summaryrefslogtreecommitdiffstats
path: root/threadlib/nopthread.h
diff options
context:
space:
mode:
authorSam Varshavchik2013-08-19 16:39:41 -0400
committerSam Varshavchik2013-08-25 14:43:51 -0400
commit9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch)
tree7a81a04cb51efb078ee350859a64be2ebc6b8813 /threadlib/nopthread.h
parenta9520698b770168d1f33d6301463bb70a19655ec (diff)
downloadcourier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2
Initial checkin
Imported from subversion report, converted to git. Updated all paths in scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'threadlib/nopthread.h')
-rw-r--r--threadlib/nopthread.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/threadlib/nopthread.h b/threadlib/nopthread.h
new file mode 100644
index 0000000..e3c8680
--- /dev/null
+++ b/threadlib/nopthread.h
@@ -0,0 +1,43 @@
+#ifndef nopthread_h
+#define nopthread_h
+
+/*
+** Copyright 2000 Double Precision, Inc. See COPYING for
+** distribution information.
+*/
+
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+struct cthreadinfo {
+ void (*workfunc)(void *);
+ void (*cleanupfunc)(void *);
+ char *metadata_buf;
+ } ;
+
+struct cthreadinfo *cthread_init(
+ unsigned, /* Number of threads */
+ unsigned, /* Size of per-thread metadata */
+ void (*)(void *), /* The work function */
+ void (*)(void *)); /* The cleanup function */
+
+void cthread_wait(struct cthreadinfo *);
+
+#define cthread_go(cit, gofunc, arg) \
+ ( (*gofunc)(cit->metadata_buf, arg), \
+ (*cit->workfunc)(cit->metadata_buf), \
+ (*cit->cleanupfunc)(cit->metadata_buf), 0)
+
+struct cthreadlock *cthread_lockcreate(void);
+void cthread_lockdestroy(struct cthreadlock *);
+int cthread_lock(struct cthreadlock *, int (*)(void *), void *);
+
+extern struct cthreadlock cthread_dummy;
+
+#define cthread_lockcreate() ( &cthread_dummy )
+#define cthread_lockdestroy(p)
+#define cthread_lock(p,func,arg) ( (*func)(arg))
+
+#endif