[CP] deal with nullptr memory_context returned by GET_TSI0

This commit is contained in:
obdev
2023-02-06 22:43:39 +08:00
committed by ob-robot
parent 275204c820
commit 30c56c298e

View File

@ -255,14 +255,13 @@ void* Thread::__th_start(void *arg)
pm.set_max_chunk_cache_cnt(cache_cnt);
ObPageManager::set_thread_local_instance(pm);
MemoryContext *mem_context = GET_TSI0(MemoryContext);
ret = ROOT_CONTEXT->CREATE_CONTEXT(*mem_context,
ContextParam().set_properties(RETURN_MALLOC_DEFAULT)
.set_label("ThreadRoot"));
if (OB_FAIL(ret)) {
LOG_ERROR("create memory context failed", K(ret));
} else if (OB_ISNULL(mem_context)) {
if (OB_ISNULL(mem_context)) {
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("null ptr", K(ret));
} else if (OB_FAIL(ROOT_CONTEXT->CREATE_CONTEXT(*mem_context,
ContextParam().set_properties(RETURN_MALLOC_DEFAULT)
.set_label("ThreadRoot")))) {
LOG_ERROR("create memory context failed", K(ret));
} else {
th->pid_ = getpid();
th->tid_ = static_cast<pid_t>(syscall(__NR_gettid));