chenBright commented on code in PR #2517: URL: https://github.com/apache/brpc/pull/2517#discussion_r1461474105
########## 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,默认值为false,如何? -- 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