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


##########
src/butil/memory/singleton.cc:
##########
@@ -5,9 +5,23 @@
 #include "butil/memory/singleton.h"
 #include "butil/threading/platform_thread.h"
 
+__BEGIN_DECLS
+// Defined in bthread/bthread.cpp
+void BAIDU_WEAK bthread_yield();
+__END_DECLS
+
 namespace butil {
 namespace internal {
 
+void yield() {
+    if (bthread_yield) {

Review Comment:
   mutex/cond比bthread_usleep优雅,但是没有合适的位置初始化mutex/cond。



-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to