Ailusa0106 commented on issue #1230: URL: https://github.com/apache/incubator-brpc/issues/1230#issuecomment-688693930
> > 嗯,多谢回复,主要是针对这个正确的姿势,拿bthread_mutex_unlock举例,假设两个thread,thread1解锁,此时锁变量的值去和0交换,交换之后利用butex_wake唤醒队列(但是此时队列为空),如果thread2 wait_for_butex这个时候看不到最新值就会lock(append进入队列),但是已经没有thread能唤醒它了。 > > 这是不可能的,wait一端获取waiter_lock后必然能看到最新值。这类多线程问题的先验知识比较多,解释起来也比较困难,你可能得自己去学习一下了。 好的,多谢戈大神回复 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
