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

可重入锁那里初始化有点问题 #2

Open
Amoteamame opened this issue Sep 23, 2021 · 1 comment
Open

可重入锁那里初始化有点问题 #2

Amoteamame opened this issue Sep 23, 2021 · 1 comment

Comments

@Amoteamame
Copy link

您好,在看这篇《Go语言如何实现可重入锁?》文章时,提供的代码:
func NewReentrantLock() sync.Locker{ res := &ReentrantLock{ lock: new(sync.Mutex), recursion: 0, host: 0, } res.cond = sync.NewCond(res.lock) return res }

这里返回值res是*ReentrantLock类型,会报错?

@asong2020
Copy link
Owner

报的什么错?

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

No branches or pull requests

2 participants