Przeglądaj źródła

Add sync lock on do() to avoid race conditions when creating jobs

tags/0.2
Christoffer Fjellström 7 lat temu
rodzic
commit
27942f55cd
1 zmienionych plików z 2 dodań i 0 usunięć
  1. +2
    -0
      client/client.go

+ 2
- 0
client/client.go Wyświetl plik

@@ -220,6 +220,8 @@ func (client *Client) do(funcname string, data []byte,
if client.conn == nil {
return "", ErrLostConn
}
client.Lock()
defer client.Unlock()
var result = make(chan handleOrError, 1)
client.lastcall = "c"
client.innerHandler.put("c", func(resp *Response) {


Ładowanie…
Anuluj
Zapisz