You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by lo...@apache.org on 2023/01/15 10:28:07 UTC

[brpc] branch master updated: Keep bthread TaskGroup abi compatible with NDEBUG macro

This is an automated email from the ASF dual-hosted git repository.

lorinlee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 3a82c275 Keep bthread TaskGroup abi compatible with NDEBUG macro
     new 745514e4 Merge pull request #2047 from wwbmmm/fix-task-group-abi
3a82c275 is described below

commit 3a82c2755a9d2d73254ce76ff8589c8a6f3cf845
Author: wwbmmm <ww...@163.com>
AuthorDate: Mon Dec 12 16:45:47 2022 +0800

    Keep bthread TaskGroup abi compatible with NDEBUG macro
---
 src/bthread/task_group.cpp | 6 +++---
 src/bthread/task_group.h   | 6 ++----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/bthread/task_group.cpp b/src/bthread/task_group.cpp
index 94ce5eb7..31d8bb41 100644
--- a/src/bthread/task_group.cpp
+++ b/src/bthread/task_group.cpp
@@ -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)];
diff --git a/src/bthread/task_group.h b/src/bthread/task_group.h
index 12ee126c..7ac366a0 100644
--- a/src/bthread/task_group.h
+++ b/src/bthread/task_group.h
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org