We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我注意到https://github.com/lifei6671/interview-go/blob/master/question/q010.md中缺少了Rdfunc的实现,我完成了,并且经过了简单的测试。
Rd
func (m *Map) Rd(key string, timeout time.Duration) interface{} { e, ok := m.c[key] if !ok { // create channel m.c[key] = &entry{ isExist: false, ch: make(chan struct{}), } } // 阻塞 e, _ = m.c[key] if e.ch != nil { select { case <-e.ch: case <-time.After(timeout): } } return m.c[key].value }
The text was updated successfully, but these errors were encountered:
没加锁?
Sorry, something went wrong.
No branches or pull requests
我注意到https://github.com/lifei6671/interview-go/blob/master/question/q010.md中缺少了
Rd
func的实现,我完成了,并且经过了简单的测试。The text was updated successfully, but these errors were encountered: