From d6791e2e42e9ae1ef338791f568a11f961d3e46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20Fjellstr=C3=B6m?= Date: Mon, 16 Jan 2017 16:44:48 +0100 Subject: [PATCH] Add sync lock to create job functions Add sync lock to make create job calls thread safe. --- client/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/client.go b/client/client.go index 368363c..222cdc6 100644 --- a/client/client.go +++ b/client/client.go @@ -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 {