chenBright commented on code in PR #2333:
URL: https://github.com/apache/brpc/pull/2333#discussion_r1278828435


##########
src/bthread/execution_queue.cpp:
##########
@@ -189,6 +208,28 @@ void* ExecutionQueueBase::_execute_tasks(void* arg) {
     return NULL;
 }
 
+void* ExecutionQueueBase::_execute_tasks_pthread(void* arg) {
+    butil::PlatformThread::SetName("ExecutionQueue");
+    auto head = (TaskNode*)arg;
+    auto m = (ExecutionQueueBase*)head->q;
+    m->_current_head = head;
+    while (true) {
+        BAIDU_SCOPED_LOCK(m->_mutex);
+        while (!m->_current_head) {
+            m->_cond.Wait();

Review Comment:
   不会。stop之后,_execute_tasks_pthread不会block在条件变量上,而是在执行完stop task后就会跳出循环并退出线程了。



##########
src/bthread/execution_queue.cpp:
##########
@@ -189,6 +208,28 @@ void* ExecutionQueueBase::_execute_tasks(void* arg) {
     return NULL;
 }
 
+void* ExecutionQueueBase::_execute_tasks_pthread(void* arg) {
+    butil::PlatformThread::SetName("ExecutionQueue");
+    auto head = (TaskNode*)arg;
+    auto m = (ExecutionQueueBase*)head->q;
+    m->_current_head = head;
+    while (true) {
+        BAIDU_SCOPED_LOCK(m->_mutex);
+        while (!m->_current_head) {
+            m->_cond.Wait();

Review Comment:
   不会。stop之后,_execute_tasks_pthread不会block在条件变量上,而是在执行完stop task后就会跳出循环并退出线程了。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to