Synchronize selected user access
This commit is contained in:
committed by
Brandon McGinty
parent
20c6997ab0
commit
3efbd019ce
@@ -84,6 +84,21 @@ func TestServerAddressDefaultsPortWithoutBreakingIPv6(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestConcurrentSelectedUserAccess(t *testing.T) {
|
||||
b := &Barnard{}
|
||||
user := &gumble.User{Session: 1}
|
||||
var wg sync.WaitGroup
|
||||
for i := 0; i < 20; i++ {
|
||||
wg.Add(1)
|
||||
go func(user *gumble.User) {
|
||||
defer wg.Done()
|
||||
b.setSelectedUserValue(user)
|
||||
_ = b.selectedUserValue()
|
||||
}(user)
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func TestConcurrentMutedChannelAccess(t *testing.T) {
|
||||
b := &Barnard{MutedChannels: make(map[uint32]bool)}
|
||||
var wg sync.WaitGroup
|
||||
|
||||
Reference in New Issue
Block a user