libgo icon indicating copy to clipboard operation
libgo copied to clipboard

mutex destroyed while busy问题找到了

Open bizehao opened this issue 2 years ago • 0 comments

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

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

bizehao avatar Mar 29 '23 00:03 bizehao