mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50:18 +01:00
Another try to fix not removing last player.
This commit is contained in:
parent
6ffa0e1001
commit
6fb338dbb8
@ -133,13 +133,17 @@ func samePlayers(a, b []*player) bool {
|
|||||||
|
|
||||||
func (ps *players) run() {
|
func (ps *players) run() {
|
||||||
for {
|
for {
|
||||||
|
ps.mu.Lock()
|
||||||
|
empty := len(ps.pls) == 0
|
||||||
|
ps.mu.Unlock()
|
||||||
|
|
||||||
pls, err := ps.readFromFIFO()
|
pls, err := ps.readFromFIFO()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
//log.Printf("err: %s\n", err)
|
//log.Printf("err: %s\n", err)
|
||||||
time.Sleep(sleepInterval)
|
time.Sleep(sleepInterval)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if pls == nil {
|
if empty && pls == nil {
|
||||||
//log.Println("no players")
|
//log.Println("no players")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user