Rev 1601 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1601 | Rev 1646 | ||
|---|---|---|---|
| Line 77... | Line 77... | ||
| 77 | this->mutex_timers_.unlock(); |
77 | this->mutex_timers_.unlock(); |
| 78 | 78 | ||
| 79 | this->signal_on_timeout_(id, repeat); |
79 | this->signal_on_timeout_(id, repeat); |
| 80 | } |
80 | } |
| 81 | 81 | ||
| - | 82 | TimerId Manager::SetAlarm(std::string time) |
|
| - | 83 | { |
|
| - | 84 | this->mutex_timers_.lock(); |
|
| - | 85 | ||
| - | 86 | Timer::Pointer timer = Timer::Pointer(new Timer(this->io_service_, this->GetFreeId(), time)); |
|
| - | 87 | ||
| - | 88 | this->timers_[timer->GetId()] = timer; |
|
| - | 89 | ||
| - | 90 | this->mutex_timers_.unlock(); |
|
| - | 91 | ||
| - | 92 | timer->ConnectSlots(Timer::SignalOnTimeout::slot_type(&Manager::SlotOnTimeout, this, _1).track(Manager::instance_)); |
|
| - | 93 | ||
| - | 94 | timer->Start(); |
|
| - | 95 | ||
| - | 96 | return timer->GetId(); |
|
| - | 97 | } |
|
| - | 98 | ||
| 82 | TimerId Manager:: |
99 | TimerId Manager::SetTimer(unsigned int timeout, bool repeat) |
| 83 | { |
100 | { |
| 84 | this->mutex_timers_.lock(); |
101 | this->mutex_timers_.lock(); |
| 85 | 102 | ||
| 86 | Timer::Pointer timer = Timer::Pointer(new Timer(this->io_service_, this->GetFreeId(), timeout, repeat)); |
103 | Timer::Pointer timer = Timer::Pointer(new Timer(this->io_service_, this->GetFreeId(), timeout, repeat)); |
| 87 | 104 | ||