changed embedded mutex to private field (#217)
Some checks failed
sync / sync (push) Failing after 16m12s
test / test (push) Failing after 17m28s
coverage / build (push) Failing after 17m40s

This commit is contained in:
2025-05-25 03:15:03 +05:00
committed by GitHub
parent 0f8f12aee0
commit 13f90ff716
13 changed files with 151 additions and 151 deletions

View File

@@ -17,7 +17,7 @@ type profiler struct {
cpuFile *os.File
memFile *os.File
opts profile.Options
sync.Mutex
mu sync.Mutex
running bool
}
@@ -39,8 +39,8 @@ func (p *profiler) writeHeap(f *os.File) {
}
func (p *profiler) Start() error {
p.Lock()
defer p.Unlock()
p.mu.Lock()
defer p.mu.Unlock()
if p.running {
return nil
@@ -86,8 +86,8 @@ func (p *profiler) Start() error {
}
func (p *profiler) Stop() error {
p.Lock()
defer p.Unlock()
p.mu.Lock()
defer p.mu.Unlock()
select {
case <-p.exit: