1.优化服务配置检查

2.废弃SetGoRoutineNum接口
3.释放Module优化
This commit is contained in:
duanhf2012
2024-12-06 16:05:25 +08:00
parent cf6ca0483b
commit ffcc5a3489
3 changed files with 28 additions and 17 deletions

View File

@@ -264,10 +264,13 @@ func (s *Service) Release() {
}
}()
for i:=len(s.child)-1; i>=0; i-- {
s.ReleaseModule(s.child[i].GetModuleId())
}
if atomic.AddInt32(&s.isRelease, -1) == -1 {
s.self.OnRelease()
}
}
func (s *Service) OnRelease() {
@@ -432,6 +435,7 @@ func (s *Service) SetEventChannelNum(num int) {
}
}
// Deprecated: replace it with the OpenConcurrent function
func (s *Service) SetGoRoutineNum(goroutineNum int32) bool {
//已经开始状态不允许修改协程数量,打开性能分析器不允许开多线程
if s.startStatus == true || s.profiler != nil {