Fixed deadlock caused by misunderstanding of how defer works.
This commit is contained in:
parent
21995ea4cd
commit
1ed81fdd36
@ -152,11 +152,11 @@ func IcecastWatchPlaylist(playlistPath string, lastNSongs int) error {
|
||||
select {
|
||||
case <-playlistFired:
|
||||
lastPlayedCacheMutex.Lock()
|
||||
defer lastPlayedCacheMutex.Unlock()
|
||||
songs, err := lastPlayedSongs(lastNSongs, playlistPath)
|
||||
if err == nil && len(songs) > 0 {
|
||||
lastPlayedCache = songs
|
||||
}
|
||||
lastPlayedCacheMutex.Unlock()
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user