Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Aug 6, 2024
1 parent fa6dd8f commit 67c7e0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion be/src/runtime/thread_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static ThreadContext* thread_context(bool allow_return_null = false) {
// in bthread
// bthread switching pthread may be very frequent, remember not to use lock or other time-consuming operations.
auto* bthread_context = static_cast<ThreadContext*>(bthread_getspecific(btls_key));
DCHECK(bthread_context != nullptr);
DCHECK(bthread_context != nullptr && bthread_context->thread_local_handle_count > 0);
return bthread_context;
}
if (allow_return_null) {
Expand Down
4 changes: 2 additions & 2 deletions be/src/vec/common/allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename Memory
void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator>::release_memory(
size_t size) const {
doris::ThreadContext* thread_context = doris::thread_context(true);
DCHECK(_tracker);
if (thread_context && thread_context->thread_mem_tracker()->label() == _tracker->label()) {
if (thread_context) {
DCHECK(!_tracker || thread_context->thread_mem_tracker()->label() == _tracker->label());
RELEASE_THREAD_MEM_TRACKER(size);
} else {
_tracker->release(size);
Expand Down

0 comments on commit 67c7e0a

Please sign in to comment.