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 1/2] 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 { From e1224a8c20ea1d1f549a88932597e85d1b1aa42d Mon Sep 17 00:00:00 2001 From: John-Lin Date: Wed, 27 Sep 2017 13:19:08 +0800 Subject: [PATCH 2/2] fixed typo and keep WorkComplate for downward compatibility --- client/common.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/common.go b/client/common.go index e520bf0..b9f03e1 100644 --- a/client/common.go +++ b/client/common.go @@ -51,6 +51,7 @@ const ( dtSubmitJobLowBg = 34 WorkComplate = dtWorkComplete + WorkComplete = dtWorkComplete WorkData = dtWorkData WorkStatus = dtWorkStatus WorkWarning = dtWorkWarning