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 destroyed while busy问题找到了 #293

Open
bizehao opened this issue Mar 29, 2023 · 0 comments
Open

mutex destroyed while busy问题找到了 #293

bizehao opened this issue Mar 29, 2023 · 0 comments

Comments

@bizehao
Copy link

bizehao commented Mar 29, 2023

用手机写得,格式不好弄,不好意思

windows 的mutex destroyed while busy问题找到了,我觉得这不只是windows的问题,

在libgo\routine_sync\rutex.h 227行左右这块,你定义了一个局部变量 RutexWaiter rw(*switcher);
在252行,你 进行了waiters_.push(&rw);,相当于把局部变量的指针放进了容器了,出这个函数,这个局部变量就析构了。我把
 RutexWaiter rw(*switcher);改成堆变量 new的形式,就正常了,测试后没有出现
mutex destroyed while busy

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

1 participant