Skip to content

Commit

Permalink
Merge pull request #2047 from wwbmmm/fix-task-group-abi
Browse files Browse the repository at this point in the history
Keep bthread TaskGroup abi compatible with NDEBUG macro
  • Loading branch information
lorinlee authored Jan 15, 2023
2 parents 9e8c0db + 3a82c27 commit 745514e
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/bthread/task_group.cpp
Original file line number Diff line number Diff line change
@@ -175,9 +175,6 @@ void TaskGroup::run_main_task() {

TaskGroup::TaskGroup(TaskControl* c)
:
#ifndef NDEBUG
_sched_recursive_guard(0),
#endif
_cur_meta(NULL)
, _control(c)
, _num_nosignal(0)
@@ -192,6 +189,9 @@ TaskGroup::TaskGroup(TaskControl* c)
, _main_tid(0)
, _remote_num_nosignal(0)
, _remote_nsignaled(0)
#ifndef NDEBUG
, _sched_recursive_guard(0)
#endif
{
_steal_seed = butil::fast_rand();
_steal_offset = OFFSET_TABLE[_steal_seed % ARRAY_SIZE(OFFSET_TABLE)];
6 changes: 2 additions & 4 deletions src/bthread/task_group.h
Original file line number Diff line number Diff line change
@@ -221,10 +221,6 @@ friend class TaskControl;
return _control->steal_task(tid, &_steal_seed, _steal_offset);
}

#ifndef NDEBUG
int _sched_recursive_guard;
#endif

TaskMeta* _cur_meta;

// the control that this group belongs to
@@ -251,6 +247,8 @@ friend class TaskControl;
RemoteTaskQueue _remote_rq;
int _remote_num_nosignal;
int _remote_nsignaled;

int _sched_recursive_guard;
};

} // namespace bthread

0 comments on commit 745514e

Please sign in to comment.