#ifndef _WORKQ_H
#define _WORKQ_H
#include <sys/types.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct workq workq_t;
typedef int (workq_proc_f)(void *, void *);
extern int workq_init(workq_t **, uint_t);
extern void workq_fini(workq_t *);
extern int workq_add(workq_t *, void *);
#define WORKQ_ERROR (-1)
#define WORKQ_UERROR (-2)
extern int workq_work(workq_t *, workq_proc_f *, void *, int *);
extern void *workq_alloc(size_t);
extern void workq_free(void *, size_t);
#ifdef __cplusplus
}
#endif
#endif