From adb1044f1a5cb8f25178f5f5e6106d8adb3d4109 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期一, 13 一月 2020 10:48:03 +0800 Subject: [PATCH] debug --- run.go | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/run.go b/run.go index c94aeff..adda50a 100644 --- a/run.go +++ b/run.go @@ -69,7 +69,6 @@ return case id := <-ch: f.mapChanLock.Lock() - defer f.mapChanLock.Unlock() for k, v := range f.mapChan { v.life-- if k == id { @@ -81,6 +80,8 @@ delete(f.mapChan, k) } } + f.mapChanLock.Unlock() + default: time.Sleep(10 * time.Millisecond) } @@ -216,9 +217,7 @@ wg := &sync.WaitGroup{} for _, msg := range msgs { - f.fnLogger("######Maintain :", msg.Cid) f.chLife <- msg.Cid - f.fnLogger("######Maintain Over :", msg.Cid) if c, ok := f.channelExist(msg.Cid); ok { wg.Add(1) @@ -246,6 +245,7 @@ } } wg.Wait() + f.fnLogger("######Wait for All track") } func (f *face) track(wg *sync.WaitGroup, msg *protomsg.SdkMessage, tchan int, out chan<- sdkstruct.MsgSDK) { @@ -253,8 +253,6 @@ defer wg.Done() rMsg := *msg - - f.fnLogger("######Recv From: ", rMsg.Cid, " Chan: ", tchan) if !sdkhelper.ValidRemoteMessage(rMsg, f.typ, f.fnLogger) { sdkhelper.EjectResult(nil, rMsg, out) @@ -274,13 +272,9 @@ // conv to bgr24 and resize imgW, imgH := int(i.Width), int(i.Height) - f.fnLogger("######Run cid:", rMsg.Cid, "chan: ", tchan) count, data, _ := f.handle.Run(i.Data, imgW, imgH, 3, tchan) - f.fnLogger("######Over run cid:", rMsg.Cid, "chan: ", tchan) - f.fnLogger("######Eject cid:", rMsg.Cid, "chan: ", tchan) sdkhelper.EjectResult(data, rMsg, out) - f.fnLogger("######Over eject cid:", rMsg.Cid, "chan: ", tchan) var id, name string if rMsg.Tasklab != nil { -- Gitblit v1.8.0