From fd9e8617b5c6fdf940a51451ad1fbfc7981164bf Mon Sep 17 00:00:00 2001 From: William Clark Date: Mon, 5 Dec 2022 13:20:34 +0000 Subject: [PATCH] mutex lock GetRatio --- core/th7/th7.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/th7/th7.go b/core/th7/th7.go index 40a2a2e..f6df0c3 100644 --- a/core/th7/th7.go +++ b/core/th7/th7.go @@ -82,5 +82,8 @@ func (t *TH7Adapter) GetPivdd() float64 { // Ratio table func (t *TH7Adapter) GetRatio() core.Ratio { + t.mu.Lock() + defer t.mu.Unlock() + return t.table }