static inline void itask() { ++intr_count_; task_(); // IR 関係フラグは必ず mov 命令で・・ volatile uint8_t r = ADICSR(); ADICSR = 0x00; }
int CB::handle_timeout (const ACE_Time_Value &tv, const void *arg) { int nRet = task_(tv); if(nRet == -1) return -1; return 0; }
bool AsyncResult::execute() { bool should_call = false; { Lock::scoped_lock locker(lock_); if (status_ == WAIT) { should_call = true; status_ = RUNNING; } } if (should_call) { try { task_(*this); set_success(); } catch (AvalonException& err) { set_error(&err); } catch (boost::thread_interrupted) { set_interrupt(); throw; } catch (...) { set_error(); } } return should_call; }
void PeriodicTask::do_work() { while (!canceled_.load()) { std::unique_lock<std::mutex> lock(cv_m_); if (!cv_.wait_for(lock, period_, [this]() { return canceled_.load(); })) { task_(); } } }
//-----------------------------------------------------------------// void sync() const noexcept { if(level_ > 0) { volatile uint32_t cnt = counter_; while(cnt == counter_) sleep_(); } else { auto ref = CMT::CMCNT(); while(ref <= CMT::CMCNT()) sleep_(); task_(); ++counter_; } }
void TaskImpl::run() { task_(); }
void run_impl() { task_(); }