-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
明显的逻辑问题,难道没人发现吗? #391
Comments
不是同一个地方. 不是room.Del(ch) 而是 buclet.Del(room) |
oroom.Del(ch) 里如果Online==0 才会返回true(这个时候没有其他客户端了),然后才会bucket.DelRoom(oroom) |
谢指教 |
这还是有bug,room.Del和b.DelRoom不是一个原子操作,room.Del为true后的瞬间,bucket中这个room又有值了呢,这时候删除room就会误删 |
仅仅是这个问题的话,加锁已经保证原子了吧。除非其他地方写的时候没加锁。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
changeRoom的时候会把bucket里面的room给删掉。
那么如果有在同一个room,而且在同一个bucket中的其他客户端,那不是一起给删了收不到消息了吗?
The text was updated successfully, but these errors were encountered: