result = vdo_allocate(1, struct thread, __func__, &thread); if (result != VDO_SUCCESS) {
vdo_log_warning("Error allocating memory for %s", name); return result;
}
thread->thread_function = thread_function;
thread->thread_data = thread_data;
init_completion(&thread->thread_done); /* * Start the thread, with an appropriate thread name. * * If the name supplied contains a colon character, use that name. This causes uds module * threads to have names like "uds:callbackW" and the main test runner thread to be named * "zub:runtest". * * Otherwise if the current thread has a name containing a colon character, prefix the name * supplied with the name of the current thread up to (and including) the colon character. * Thus when the "kvdo0:dedupeQ" thread opens an index session, all the threads associated * with that index will have names like "kvdo0:foo". * * Otherwise just use the name supplied. This should be a rare occurrence.
*/ if ((name_colon == NULL) && (my_name_colon != NULL)) {
task = kthread_run(thread_starter, thread, "%.*s:%s",
(int) (my_name_colon - current->comm), current->comm,
name);
} else {
task = kthread_run(thread_starter, thread, "%s", name);
}
if (IS_ERR(task)) {
vdo_free(thread); return PTR_ERR(task);
}
*new_thread = thread; return VDO_SUCCESS;
}
void vdo_join_threads(struct thread *thread)
{ while (wait_for_completion_interruptible(&thread->thread_done))
fsleep(1000);
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.