// SPDX-License-Identifier: GPL-2.0 /* * An API to allow a function, that may fail, to be executed, and recover in a * controlled manner. * * Copyright (C) 2019, Google LLC. * Author: Brendan Higgins <brendanhiggins@google.com>
*/
try_catch->context = context;
try_catch->try_result = 0;
task_struct = kthread_create(kunit_generic_run_threadfn_adapter,
try_catch, "kunit_try_catch_thread"); if (IS_ERR(task_struct)) {
try_catch->try_result = PTR_ERR(task_struct);
try_catch->catch(try_catch->context); return;
}
get_task_struct(task_struct); /* * As for a vfork(2), task_struct->vfork_done (pointing to the * underlying kthread->exited) can be used to wait for the end of a * kernel thread. It is set to NULL when the thread exits, so we * keep a copy here.
*/
task_done = task_struct->vfork_done;
wake_up_process(task_struct);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.