wwbmmm commented on code in PR #2517:
URL: https://github.com/apache/brpc/pull/2517#discussion_r1461431437
##########
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:
是不是加个开关控制一下?毕竟大部分Singleton场景,是不需要bthread_yield的
--
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]