forked from yuxh/gearman-go
Add sync lock to create job functions
Add sync lock to make create job calls thread safe.
This commit is contained in:
parent
b79fee2965
commit
d6791e2e42
@ -221,6 +221,8 @@ func (client *Client) do(funcname string, data []byte,
|
||||
return "", ErrLostConn
|
||||
}
|
||||
var result = make(chan handleOrError, 1)
|
||||
client.Lock()
|
||||
defer client.Unlock()
|
||||
client.lastcall = "c"
|
||||
client.innerHandler.put("c", func(resp *Response) {
|
||||
if resp.DataType == dtError {
|
||||
|
Loading…
Reference in New Issue
Block a user