mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
module exit error
This commit is contained in:
@@ -2,14 +2,16 @@ package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/duanhf2012/origin/event"
|
||||
"github.com/duanhf2012/origin/log"
|
||||
rpcHandle "github.com/duanhf2012/origin/rpc"
|
||||
"github.com/duanhf2012/origin/util/timer"
|
||||
"reflect"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
)
|
||||
|
||||
const InitModuleId = 1e9
|
||||
|
||||
type IModule interface {
|
||||
@@ -123,8 +125,8 @@ func (m *Module) ReleaseModule(moduleId uint32){
|
||||
m.ReleaseModule(id)
|
||||
}
|
||||
|
||||
pModule.GetEventHandler().Destroy()
|
||||
pModule.self.OnRelease()
|
||||
pModule.GetEventHandler().Destroy()
|
||||
log.SDebug("Release module ", pModule.GetModuleName())
|
||||
for pTimer := range pModule.mapActiveTimer {
|
||||
pTimer.Cancel()
|
||||
@@ -155,6 +157,7 @@ func (m *Module) NewModuleId() uint32{
|
||||
}
|
||||
|
||||
var timerSeedId uint32
|
||||
|
||||
func (m *Module) GenTimerId() uint64 {
|
||||
for {
|
||||
newTimerId := (uint64(m.GetModuleId()) << 32) | uint64(atomic.AddUint32(&timerSeedId, 1))
|
||||
@@ -166,7 +169,6 @@ func (m *Module) GenTimerId() uint64{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func (m *Module) GetAncestor() IModule {
|
||||
return m.ancestor
|
||||
}
|
||||
@@ -287,8 +289,6 @@ func (m *Module) CancelTimerId(timerId *uint64) bool{
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
|
||||
func (m *Module) OnRelease() {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user