Commit a8ee2fc9 authored by fangyincheng's avatar fangyincheng

Fix:coding details

parent c234ab8d
...@@ -508,7 +508,7 @@ LOOP: ...@@ -508,7 +508,7 @@ LOOP:
// this case branch assure the (session)handleLoop gr will exit before (session)handlePackage gr. // this case branch assure the (session)handleLoop gr will exit before (session)handlePackage gr.
if atomic.LoadInt32(&(s.grNum)) == 1 { // make sure @(session)handlePackage goroutine has been closed. if atomic.LoadInt32(&(s.grNum)) == 1 { // make sure @(session)handlePackage goroutine has been closed.
if len(s.wQ) == 0 { if len(s.wQ) == 0 {
log.Infof("%s, [session.handleLoop] got done signal. Both rQ and wQ are nil.", s.Stat()) log.Infof("%s, [session.handleLoop] got done signal. Both wQ are nil.", s.Stat())
break LOOP break LOOP
} }
counter.Start() counter.Start()
...@@ -551,10 +551,7 @@ func (s *session) addTask(pkg interface{}) { ...@@ -551,10 +551,7 @@ func (s *session) addTask(pkg interface{}) {
s.incReadPkgNum() s.incReadPkgNum()
} }
if s.tPool != nil { if s.tPool != nil {
s.tPool.AddTask(func() { s.tPool.AddTask(f)
s.listener.OnMessage(s, pkg)
s.incReadPkgNum()
})
return return
} }
f() f()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment