本文整理汇总了C++中running函数的典型用法代码示例。如果您正苦于以下问题:C++ running函数的具体用法?C++ running怎么用?C++ running使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了running函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Q_UNUSED
void Function::preRun(MasterTimer* timer)
{
Q_UNUSED(timer);
qDebug() << "Function preRun. ID: " << m_id;
m_stop = false;
m_running = true;
emit running(m_id);
}
示例2: CThreadAnimation
/*
* External constructor
*/
CThreadAnimation *CThreadAnimation::create(const STRING file, const int x, const int y, const int width, const int height, const bool bPersist)
{
if (!file.empty() && !running(file, x, y))
{
CThreadAnimation *p = new CThreadAnimation(file, x, y, bPersist);
p->m_pAnm->resize(width, height);
m_threads.insert(p);
return p;
}
}
示例3: connect
void KWin::Script::run()
{
if (running() || m_starting) {
return;
}
m_starting = true;
QFutureWatcher<QByteArray> *watcher = new QFutureWatcher<QByteArray>(this);
connect(watcher, SIGNAL(finished()), SLOT(slotScriptLoadedFromFile()));
watcher->setFuture(QtConcurrent::run(this, &KWin::Script::loadScriptFromFile));
}
示例4: running
bool ProcessInterfaceTemplate::stopping()
{
string answer;
OMethodStringStream running("stopping");
answer= sendMethod(m_sSendTo, running, true);
if(answer == "true")
return true;
return false;
}
示例5: BOOST_ASSERT
void PerformanceTimer::stop()
{
BOOST_ASSERT(running());
// if there is an existing step pending then record its duration
recordPendingStep();
// reset start time
startTime_ = ptime(not_a_date_time);
}
示例6: stop
void ScanStatus::
stop()
{
status = 1;
if( running() ) {
if( gui ) gui->set_done(1);
cancel();
join();
}
}
示例7: CUDA_CHECK
void Timer::Stop() {
if (running()) {
if (Caffe::mode() == Caffe::GPU) {
CUDA_CHECK(cudaEventRecord(stop_gpu_, 0));
CUDA_CHECK(cudaEventSynchronize(stop_gpu_));
} else {
stop_cpu_ = boost::posix_time::microsec_clock::local_time();
}
running_ = false;
}
}
示例8: run
void Clock::run() {
for (;;) {
if (running()) {
std::this_thread::sleep_for(period);
clk.get()->notify_all();
}
else {
break;
}
}
}
示例9: running
//--------------------------------------------------------------
void Tween::reset(int a_millis) {
if (!_isComplete) {
*_propAdd = _begin;
_startTime = a_millis;
_time = 0.f;
_isComplete = false;
}
cout << "Tween :: reset : running: " << running() << " complete: " << complete() << endl;
}
示例10:
ColorThread::~ColorThread()
{
if(running())
{
window->set_done(0);
completion->lock("ColorThread::~ColorThread");
completion->unlock();
}
delete mutex;
delete completion;
}
示例11: start
void CompassCalibrator::start(bool retry, float delay, uint16_t offset_max) {
if(running()) {
return;
}
_offset_max = offset_max;
_attempt = 1;
_retry = retry;
_delay_start_sec = delay;
_start_time_ms = AP_HAL::millis();
set_status(COMPASS_CAL_WAITING_TO_START);
}
示例12: PyEval_InitThreads
void singlethreaded::execute_async(unsigned niter)
{
PyEval_InitThreads();
assert(PyEval_ThreadsInitialized());
boost::mutex::scoped_lock l(iface_mtx);
// compute_stack(); //FIXME hack for python based tendrils.
scoped_ptr<thread> tmp(new thread(bind(&singlethreaded::execute_impl, this, niter)));
tmp->swap(runthread);
while(!running()) usleep(5); //TODO FIXME condition variable?
}
示例13: LOG
float CPUTimer::MicroSeconds() {
if (!has_run_at_least_once()) {
LOG(WARNING) << "Timer has never been run before reading time.";
return 0;
}
if (running()) {
Stop();
}
this->elapsed_microseconds_ = (this->stop_cpu_ -
this->start_cpu_).total_microseconds();
return this->elapsed_microseconds_;
}
示例14: stop
edthreaded_fd::~edthreaded_fd()
{
if (running())
stop();
pthread_join(m_thread, nullptr);
pthread_mutex_destroy(&m_send_lock);
pthread_mutex_destroy(&m_recv_lock);
pthread_mutex_destroy(&m_error_lock);
pthread_mutex_destroy(&m_running_lock);
delete m_wait_timer;
close(m_fd);
}
示例15: set_fd
bool edthreaded_fd::set_fd(int32_t fd_)
{
if (running())
{
_setError(AlreadyRunning, 0);
return false;
}
if (m_fd != -1)
close(m_fd);
m_fd = fd_;
return true;
}