#ifndef CJOB_CJOB_H_ #define CJOB_CJOB_H_ #include #include #include "spinlock/spinlock.h" typedef void (*CJobFn)(void *arg); typedef struct CJob { struct CJob *next; CJobFn fn; void *arg; int32_t id; } CJob; typedef struct { SpinLock spinlock; CJob *cjobs; } CJobs; extern CJobs CJOBS; void cjob_init(void); int32_t cjob_register(CJobFn fn, void *arg); void cjob_runjobs(void); #endif // CJOB_CJOB_H_