From 38a7f91330e899f728f6233f843cbde30ef95b14 Mon Sep 17 00:00:00 2001 From: wangxingxing Date: Fri, 19 Jun 2020 10:43:31 +0800 Subject: [PATCH] add ci lock func --- serveconn.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/serveconn.go b/serveconn.go index 61f44e4..0d5498c 100644 --- a/serveconn.go +++ b/serveconn.go @@ -147,6 +147,16 @@ func (ci *ConnectionInfo) NotifyWhenClose(f func()) { ci.l.Unlock() } +// Begin a connetction lock +func (ci *ConnectionInfo) Lock() { + ci.l.Lock() +} + +// Release a connection lock +func (ci *ConnectionInfo) UnLock() { + ci.l.Unlock() +} + // Server returns the server func (sc *serveconn) Server() *Server { return sc.server