Exemple #1
0
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));
    }
}
Exemple #2
0
void sig_func(int )
{
	// printf("got alarm\n");
	NextTime(year,mouth,day,hour,min,second);
	alarm(1);
}