static camkes_error_action_t UNUSED /*? error_handler ?*/(camkes_error_t *error) { if (/*? error_handler ?*/_fn == NULL) { /* No registered handler; invoke the generic error handler. */ return camkes_error(error); } return /*? error_handler ?*/_fn(error); }
uptr_t eval(uptr_t *env, uptr_t form) { if (IS_INT(form) || IS_NIL(form)) return form; if (IS_SYM(form)) return get(*env, form); if (IS_CONS(form)) { uptr_t *form_p = refer(form), *fn_p = refer(eval(env, CAR(*form_p))), rval; if (IS_SYM(*fn_p)) { rval = exec_special(env, *form_p); } else if (IS_CONS(*fn_p) && SVAL(CAR(*fn_p)) == S_FN) { rval = _fn(env, *fn_p, eval_list(env, CDR(*form_p))); } else { printf_P(PSTR("ERROR: ")); print_form(CAR(*form_p)); printf_P(PSTR(" cannot be in function position.\n")); rval = NIL; } release(2); // form_p, fn_p return rval; } return NIL; }
/* * I don't know if we can be absolutely certain that the fn and arg * parameters are preserved when returning as the child. If the * compiler stores them in registers (r0-r7), they should be. */ int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...) { register int (*_fn)(void *arg) = fn; register void *_arg = arg; int err; /* Sanity check the arguments */ err = -EINVAL; if (!fn) goto syscall_error; if (!child_stack) goto syscall_error; err = INLINE_SYSCALL(clone, 2, flags, child_stack); if (err < 0) goto syscall_error; else if (err != 0) return err; _exit(_fn(_arg)); syscall_error: __set_errno (-err); return -1; }
// Obtain value of the cached function for k V operator()(const K& k) { V v; if (!get(k,v)) { v=_fn(k); insert(k,v); } return v; }
static void _call_set_v( GLuint /*program*/, GLuint location, void(GLAPIENTRY *_fn)(UI, SI, const T*), const T* v ) { _fn(location, 1, v); }
static void _call_set_t( GLuint program, GLuint location, void(GLAPIENTRY *_fn)(GLuint, UI, P, P, P, P), P v0, P v1, P v2, P v3 ) { _fn(program, location, v0, v1, v2, v3); }
static void _call_set_t( GLuint program, GLuint location, void(GLAPIENTRY *_fn)(GLuint, UI, P), P v0 ) { _fn(program, location, v0); }
static void _call_set_v( GLuint program, GLuint location, void(GLAPIENTRY *_fn)(GLuint, UI, SI, const T*), const T* v ) { _fn(program, location, 1, v); }
static void _call_set_t( GLuint /*program*/, GLuint location, void(GLAPIENTRY *_fn)(UI, P, P, P), P v0, P v1, P v2 ) { _fn(location, v0, v1, v2); }
void BufferingAgent::run() { _halt = false; while(1) { if(_halt) return; DataBlobHash& hash = *(_buffer.next()); // blocks until ready if(_halt) return; _fn(hash); _queue.push_back(&hash); } }
static void _call_set_m( GLuint program, GLuint location, GLsizei count, GLboolean transpose, void(GLAPIENTRY *_fn)(GLuint, ID, CT, TP, const T*), const T* v ) { _fn(program, location, count, transpose, v); }
void task_run(void (*_fn)(void*), void *_arg) { LeaveCriticalSection(); //bufferPrintf("tasks: New task started %s. 0x%08x(0x%08x).\r\n", // CurrentRunning->taskName, _fn, _arg); _fn(_arg); //bufferPrintf("tasks: Task ending %s. 0x%08x(0x%08x).\r\n", // CurrentRunning->taskName, _fn, _arg); EnterCriticalSection(); task_stop(); }
/** Entry point for new kernel threads. Make this thread a DDE26 * worker and then execute the real thread fn. */ static void __kthread_helper(void *arg) { struct __kthread_data *k = (struct __kthread_data *)arg; /* * Make a copy of the fn and arg pointers, as the kthread struct is * deleted by our parent after notifying it and this may happen before we * get to execute the function. */ int (*_fn)(void*) = k->fn; void *_arg = k->arg; l4dde26_process_add_worker(); /* * Handshake with creator - we store our thread data in the * kthread struct and then unlock the lock to notify our * creator about completing setup */ k->kthread = (dde26_thread_data *)ddekit_thread_get_my_data(); ddekit_lock_unlock(&k->lock); do_exit(_fn(_arg)); }
void operator()(T&& i) { _c += _fn(std::forward<T>(i)); if (countAlso) { ++_cnt; } }
void JobTask::_on_execute() { _fn(); }
void runner::impl::run() { _fn(); }
bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, String requestUri) override { currentReqUri = requestUri; _fn(this, requestUri, requestMethod); currentReqUri = ""; return true; }
void Write(const bytes& data) { _fn(data); }