lib9p

Go 9P library.
Log | Files | Refs

commit 866613c7df3d3e940e0cce09005798153f8d1e9f
parent 50aa38c6826b65396c0399d3a82b6a5ce6f3abb6
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Thu, 19 Oct 2023 10:39:31 +0900

change function names

Diffstat:
Mfid.go | 2+-
Mreq.go | 4++--
Mserver.go | 4++--
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fid.go b/fid.go @@ -50,7 +50,7 @@ type FidPool struct { lock *sync.Mutex } -func allocFidPool() *FidPool { +func newFidPool() *FidPool { return &FidPool{ m: make(map[uint32]*Fid), lock: new(sync.Mutex), diff --git a/req.go b/req.go @@ -26,7 +26,7 @@ type ReqPool struct { lock *sync.Mutex } -func allocReqPool() *ReqPool { +func newReqPool() *ReqPool { return &ReqPool{ m: make(map[uint16]*Req), lock: new(sync.Mutex), @@ -34,7 +34,7 @@ func allocReqPool() *ReqPool { } // Add allocates a Req with the specified tag in ReqPool rp. -// It returns nil, ErrDupTag if there is already a Req with the specified tag. +// It returns (nil, ErrDupTag) if there is already a Req with the specified tag. func (rp *ReqPool) add(tag uint16) (*Req, error) { rp.lock.Lock() defer rp.lock.Unlock() diff --git a/server.go b/server.go @@ -47,8 +47,8 @@ func NewServer(fsys FS, mSize uint32, r io.Reader, w io.Writer) *Server { fs: fsys, msize: mSize, mSizeLock: new(sync.Mutex), - fPool: allocFidPool(), - rPool: allocReqPool(), + fPool: newFidPool(), + rPool: newReqPool(), } s.listenChan, s.listenErrChan = s.runListener(r) s.speakChan, s.speakErrChan = s.runSpeaker(w)