예제 #1
0
func (this *Thread) sendMsg(msgObject *MsgObject) {
	exception.Try(
		func() {
			this.msgChannel <- msgObject
		},
		func(exception interface{}) {
			fmt.Println(exception)
		})
}
예제 #2
0
func (this *Thread) notifyDaemonRoutineExit() {
	if this.isDaemonMode {
		exception.Try(
			func() {
				this.shouldDaemonChannelQuit <- true
			},
			func(exception interface{}) {
				fmt.Println(exception)
			})
	}
}
예제 #3
0
func (this *ThreadPool) Stop() {
	for i := 0; i < this.threadArray.Len(); i++ {
		thread := this.threadArray.GetObjectAtIndex(i).(thread.IThread)
		thread.Stop()
	}
	this.threadArray.RemoveAllObjects()

	if this.isDaemonMode {
		exception.Try(
			func() {
				this.shouldDaemonChannelQuit <- true
			},
			func(exception interface{}) {
				fmt.Println(exception)
			})
	}
}