From 7cf9c37fe39ed62d0b7a2906aed2d73f38b9f3e9 Mon Sep 17 00:00:00 2001 From: niklr Date: Wed, 21 Jul 2021 08:24:51 +0200 Subject: [PATCH] Rename mutex in pprof service --- api/service/pprof/service.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/service/pprof/service.go b/api/service/pprof/service.go index 1f3e8aa05..5dff882e1 100644 --- a/api/service/pprof/service.go +++ b/api/service/pprof/service.go @@ -50,7 +50,7 @@ var ( initOnce sync.Once svc = &Service{} cpuFile *os.File - lock sync.Mutex + cpuLock sync.Mutex ) // NewService creates the new pprof service @@ -178,8 +178,8 @@ func saveProfile(profile Profile, dir string) error { // restartCpuProfile stops the current CPU profile, if any and then starts a new CPU profile. While profiling in the background, the profile will be buffered and written to a file. func restartCpuProfile(dir string) error { - lock.Lock() - defer lock.Unlock() + cpuLock.Lock() + defer cpuLock.Unlock() stopCpuProfile() f, err := newTempFile(dir, CPU, ".pb.gz") if err != nil {