Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47d7a4e

Browse files
committed
bugfix
1 parent 3e77477 commit 47d7a4e

File tree

1 file changed

+3
-0
lines changed
  • websites/code2/studygolang/src/logic

1 file changed

+3
-0
lines changed

websites/code2/studygolang/src/logic/book.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ func (this *book) AddUser(user, serverId int) *UserData {
100100

101101
// 删除用户
102102
func (this *book) DelUser(user, serverId int) {
103+
this.rwMutex.Lock()
104+
defer this.rwMutex.Unlock()
105+
103106
// 自己只有一个页面建立websocket连接
104107
if this.users[user].Len() == 1 {
105108
delete(this.users, user)

0 commit comments

Comments
 (0)