fox-half-tian opened a new issue, #3194:
URL: https://github.com/apache/brpc/issues/3194

   我需要将原本运行在 pthread 上的业务切换到 bthread 上,但有的业务中 pthread 互斥锁设置了属性 
PTHREAD_MUTEX_RECURSIVE_NP,这导致无法直接实现 bthread 切换。
   
   我看了 bthread_mutex_init 源码实现,虽然有 attr 参数,但是看上去是为了兼容 pthread_mutex_init,其实忽略了 
attr 参数。
   
   为什么不做实现呢?这与官方文档 Goals 
章节所述“bthread所有接口可在pthread中被调用并有合理的行为,使用bthread的代码可以在pthread中正常执行。”并不完全准确。
   
   如果需要兼容,看上去我需要参考 pthread,基于 bthread 封装一个实现,添加 owner id 和ref_ count 来实现 
bthread 级别的递归锁,有这样的实现案例吗?


-- 
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