cregit-Linux how code gets into the kernel

Release 4.7 include/linux/delayed_call.h

Directory: include/linux
#ifndef _DELAYED_CALL_H

#define _DELAYED_CALL_H

/*
 * Poor man's closures; I wish we could've done them sanely polymorphic,
 * but...
 */


struct delayed_call {
	
void (*fn)(void *);
	
void *arg;
};


#define DEFINE_DELAYED_CALL(name) struct delayed_call name = {NULL, NULL}

/* I really wish we had closures with sane typechecking... */

static inline void set_delayed_call(struct delayed_call *call, void (*fn)(void *), void *arg) { call->fn = fn; call->arg = arg; }

Contributors

PersonTokensPropCommitsCommitProp
al viroal viro38100.00%1100.00%
Total38100.00%1100.00%


static inline void do_delayed_call(struct delayed_call *call) { if (call->fn) call->fn(call->arg); }

Contributors

PersonTokensPropCommitsCommitProp
al viroal viro27100.00%1100.00%
Total27100.00%1100.00%


static inline void clear_delayed_call(struct delayed_call *call) { call->fn = NULL; }

Contributors

PersonTokensPropCommitsCommitProp
al viroal viro18100.00%1100.00%
Total18100.00%1100.00%

#endif

Overall Contributors

PersonTokensPropCommitsCommitProp
al viroal viro119100.00%1100.00%
Total119100.00%1100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}