コード例 #1
0
ファイル: DeviceTime.cpp プロジェクト: Algomorph/HAL
void WaitForTime(double nextTime)
{
    // check if timestamp is the top of the queue
    // if not, wait until the older timestamp is popped by another thread.
    std::unique_lock<std::mutex> lock(MUTEX);
    CONDVAR.wait( lock, [=]{return  NextTime() >= nextTime;});

    // TODO: Sleep for appropriate amount of time.
    if(REALTIME) {
        std::this_thread::sleep_for(std::chrono::milliseconds(1));
    }
}
コード例 #2
0
ファイル: time_clock.cpp プロジェクト: jason0913/intev
void sig_func(int )
{
	// printf("got alarm\n");
	NextTime(year,mouth,day,hour,min,second);
	alarm(1);
}