base_service draft and some samples

This commit is contained in:
Jae Kwon
2015-07-19 17:42:01 -07:00
parent 111f001767
commit c30d38270c
4 changed files with 152 additions and 86 deletions

View File

@ -53,7 +53,12 @@ func (t *RepeatTimer) Reset() {
go t.fireRoutine(t.ticker)
}
// For ease of .Stop()'ing services before .Start()'ing them,
// we ignore .Stop()'s on nil RepeatTimers.
func (t *RepeatTimer) Stop() bool {
if t == nil {
return false
}
t.mtx.Lock() // Lock
defer t.mtx.Unlock()