diff options
Diffstat (limited to 'threadlib/nopthread.h')
| -rw-r--r-- | threadlib/nopthread.h | 43 | 
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 | 
