wasphin commented on code in PR #2333:
URL: https://github.com/apache/brpc/pull/2333#discussion_r1278812492
##########
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:
这里 join 时有可能 block 住吗?
##########
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:
这里 join 时有可能 block 住吗?
--
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]