correct the use of ObCtxIds::CO_STACK

This commit is contained in:
obdev 2023-01-09 04:15:34 +00:00 committed by ob-robot
parent 0869d3f3f5
commit 7b1f4c849a

View File

@ -59,7 +59,7 @@ int Threads::do_set_thread_count(int64_t n_threads)
} else if (n_threads == n_threads_) {
} else {
auto new_threads = reinterpret_cast<Thread**>(
ob_malloc(sizeof (Thread*) * n_threads, ObMemAttr(0 == GET_TENANT_ID() ? OB_SERVER_TENANT_ID : GET_TENANT_ID(), "Coro", ObCtxIds::CO_STACK, OB_NORMAL_ALLOC)));
ob_malloc(sizeof (Thread*) * n_threads, ObMemAttr(0 == GET_TENANT_ID() ? OB_SERVER_TENANT_ID : GET_TENANT_ID(), "Coro", ObCtxIds::DEFAULT_CTX_ID, OB_NORMAL_ALLOC)));
if (new_threads == nullptr) {
ret = OB_ALLOCATE_MEMORY_FAILED;
} else {
@ -170,7 +170,7 @@ int Threads::start()
ob_abort();
} else {
threads_ = reinterpret_cast<Thread**>(
ob_malloc(sizeof (Thread*) * n_threads_, ObMemAttr(0 == GET_TENANT_ID() ? OB_SERVER_TENANT_ID : GET_TENANT_ID(), "Coro", ObCtxIds::CO_STACK, OB_NORMAL_ALLOC)));
ob_malloc(sizeof (Thread*) * n_threads_, ObMemAttr(0 == GET_TENANT_ID() ? OB_SERVER_TENANT_ID : GET_TENANT_ID(), "Coro", ObCtxIds::DEFAULT_CTX_ID, OB_NORMAL_ALLOC)));
if (threads_ == nullptr) {
ret = OB_ALLOCATE_MEMORY_FAILED;
}
@ -213,7 +213,7 @@ int Threads::create_thread(Thread *&thread, std::function<void()> entry)
{
int ret = OB_SUCCESS;
thread = nullptr;
const auto buf = ob_malloc(sizeof (Thread), ObMemAttr(0 == GET_TENANT_ID() ? OB_SERVER_TENANT_ID : GET_TENANT_ID(), "Coro", ObCtxIds::CO_STACK, OB_NORMAL_ALLOC));
const auto buf = ob_malloc(sizeof (Thread), ObMemAttr(0 == GET_TENANT_ID() ? OB_SERVER_TENANT_ID : GET_TENANT_ID(), "Coro", ObCtxIds::DEFAULT_CTX_ID, OB_NORMAL_ALLOC));
if (buf == nullptr) {
ret = OB_ALLOCATE_MEMORY_FAILED;
} else {