Handle continous jobs via new subsystem - CJob
This commit is contained in:
29
kernel/cjob/cjob.h
Normal file
29
kernel/cjob/cjob.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef CJOB_CJOB_H_
|
||||
#define CJOB_CJOB_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#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_
|
||||
Reference in New Issue
Block a user