From 54e115f1c960ac2263a29a5af44b79c7e09f3817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 3 Mar 2021 14:28:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E5=AD=98=E7=BC=93=E5=AD=98=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84lock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/writer_memory.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/caches/writer_memory.go b/internal/caches/writer_memory.go index a60c3cd..39c1b90 100644 --- a/internal/caches/writer_memory.go +++ b/internal/caches/writer_memory.go @@ -38,20 +38,14 @@ func NewMemoryWriter(m map[uint64]*MemoryItem, key string, expiredAt int64, stat // 写入数据 func (this *MemoryWriter) WriteHeader(data []byte) (n int, err error) { this.headerSize += int64(len(data)) - - this.locker.Lock() this.item.HeaderValue = append(this.item.HeaderValue, data...) - this.locker.Unlock() return len(data), nil } // 写入数据 func (this *MemoryWriter) Write(data []byte) (n int, err error) { this.bodySize += int64(len(data)) - - this.locker.Lock() this.item.BodyValue = append(this.item.BodyValue, data...) - this.locker.Unlock() return len(data), nil }