thread: add info logs
If the operation function is not specified in spdk thread lib init. Add a info logs to tell user that you should manage and poll the thread. Change-Id: I536c6954c129fbbbc2d19776866fa348d49688ee Signed-off-by: Jin Yu <jin.yu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2804 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
d3e9384c5a
commit
817c7b4f6c
@ -124,7 +124,12 @@ spdk_thread_lib_init(spdk_new_thread_fn new_thread_fn, size_t ctx_sz)
|
||||
{
|
||||
assert(g_new_thread_fn == NULL);
|
||||
assert(g_thread_op_fn == NULL);
|
||||
g_new_thread_fn = new_thread_fn;
|
||||
|
||||
if (new_thread_fn == NULL) {
|
||||
SPDK_INFOLOG(SPDK_LOG_THREAD, "new_thread_fn was not specified at spdk_thread_lib_init\n");
|
||||
} else {
|
||||
g_new_thread_fn = new_thread_fn;
|
||||
}
|
||||
|
||||
return _thread_lib_init(ctx_sz);
|
||||
}
|
||||
@ -143,8 +148,12 @@ spdk_thread_lib_init_ext(spdk_thread_op_fn thread_op_fn,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
g_thread_op_fn = thread_op_fn;
|
||||
g_thread_op_supported_fn = thread_op_supported_fn;
|
||||
if (thread_op_fn == NULL && thread_op_supported_fn == NULL) {
|
||||
SPDK_INFOLOG(SPDK_LOG_THREAD, "thread_op_fn and thread_op_supported_fn were not specified\n");
|
||||
} else {
|
||||
g_thread_op_fn = thread_op_fn;
|
||||
g_thread_op_supported_fn = thread_op_supported_fn;
|
||||
}
|
||||
|
||||
return _thread_lib_init(ctx_sz);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user