Merge pull request #2151 from slingamn/modes_forwardport

fix deadlock on channel state mutex
This commit is contained in:
Shivaram Lingamneni 2024-05-06 08:47:23 +02:00 committed by GitHub
commit ca4b9c15c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -612,9 +612,11 @@ func (channel *Channel) Founder() string {
func (channel *Channel) HighestUserMode(client *Client) (result modes.Mode) {
channel.stateMutex.RLock()
clientModes := channel.members[client].modes
channel.stateMutex.RUnlock()
return clientModes.HighestChannelUserMode()
defer channel.stateMutex.RUnlock()
if clientData, ok := channel.members[client]; ok {
return clientData.modes.HighestChannelUserMode()
}
return
}
func (channel *Channel) Settings() (result ChannelSettings) {