Advertisement
Guest User

help

a guest
Apr 8th, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. // The thread running
  2. timer_thread_ = std::thread([this] {
  3.     duration_t prev = duration_t::zero();
  4.     while (true) {
  5.         timer_evt_manager_.wait_until_push();
  6.         if (timer_evt_manager_.wait_for(prev)) continue;
  7.         timer_evt_manager_.execute_next_in_line();
  8.     }
  9. });
  10.  
  11. // Dispatching events (never called in code though)
  12. void EventManager::dispatch_as_timer_event(const std::string& evt_name, const duration_t nsec) {
  13.     timer_evt_manager_.dispatch_timer_event(TimerEventFunction{scene_.get().registered_events().at(evt_name), nsec});
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement