diff --git a/be/src/runtime/thread_context.h b/be/src/runtime/thread_context.h index 20a0b074c1287b..861b3e05672969 100644 --- a/be/src/runtime/thread_context.h +++ b/be/src/runtime/thread_context.h @@ -249,19 +249,8 @@ static void attach_bthread() { #endif // Create thread-local data on demand. bthread_context = new ThreadContext; - std::shared_ptr btls_tracker = - std::make_shared(-1, "Bthread:id=" + std::to_string(bthread_id), - ExecEnv::GetInstance()->bthread_mem_tracker()); - bthread_context->attach_task(ThreadContext::TaskType::BRPC, "", TUniqueId(), btls_tracker); // set the data so that next time bthread_getspecific in the thread returns the data. CHECK_EQ(0, bthread_setspecific(btls_key, bthread_context)); - } else { - // two scenarios: - // 1. A new bthread starts, but get a reuses btls. - // 2. A pthread switch occurs. Because the pthread switch cannot be accurately identified at the moment. - // So tracker call reset 0 like reuses btls. - DCHECK(bthread_context->_thread_mem_tracker_mgr->get_attach_layers() == 2); - bthread_context->_thread_mem_tracker_mgr->limiter_mem_tracker_raw()->reset_zero(); } }