Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于mutex的疑问 #80

Open
cuglaiyp opened this issue Jul 2, 2021 · 1 comment
Open

关于mutex的疑问 #80

cuglaiyp opened this issue Jul 2, 2021 · 1 comment
Labels

Comments

@cuglaiyp
Copy link

cuglaiyp commented Jul 2, 2021

问题描述

在5.3 mutex一节中,开头有这么一句话

在正常模式中,等待者按照 FIFO 的顺序排队获取锁

我注意到这个是官方注释
在下文的unlockSlow方法中,正常唤醒逻辑的代码是runtime_Semrelease(&m.sema, false, 1),您的注释是

唤醒一个阻塞的 goroutine,但不是唤醒第一个等待者

这两个说法是不是冲突了?

@changkun
Copy link
Member

抱歉回复晚了, 刚才看了一下, 这个注释确实是有问题的.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants