1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 10:35:10 +00:00

revise my comments for clarity

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@962 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Philip Kovacs 2007-09-02 17:14:15 +00:00
parent 94e918914d
commit fadea17e90

View File

@ -191,14 +191,14 @@ timed_thread_test (timed_thread* p_timed_thread)
/* add in the wait interval */ /* add in the wait interval */
if (1000000000-wait_time.tv_nsec <= p_timed_thread->interval_time.tv_nsec) if (1000000000-wait_time.tv_nsec <= p_timed_thread->interval_time.tv_nsec)
{ {
/* adjust for impending overflow of wait_time.tv_nsec */ /* perform nsec->sec carry operation */
wait_time.tv_sec += p_timed_thread->interval_time.tv_sec + 1; wait_time.tv_sec += p_timed_thread->interval_time.tv_sec + 1;
wait_time.tv_nsec = wait_time.tv_nsec - (1000000000 - p_timed_thread->interval_time.tv_nsec); wait_time.tv_nsec -= 1000000000-p_timed_thread->interval_time.tv_nsec;
/*printf ("001:wait_time.tv_secs = %li, .tv_nsecs = %li\n", wait_time.tv_sec, wait_time.tv_nsec);*/ /*printf ("001:wait_time.tv_secs = %li, .tv_nsecs = %li\n", wait_time.tv_sec, wait_time.tv_nsec);*/
} }
else else
{ {
/* no overflow will occur, just add respective components */ /* no carry needed, just add respective components */
wait_time.tv_sec += p_timed_thread->interval_time.tv_sec; wait_time.tv_sec += p_timed_thread->interval_time.tv_sec;
wait_time.tv_nsec += p_timed_thread->interval_time.tv_nsec; wait_time.tv_nsec += p_timed_thread->interval_time.tv_nsec;
/*printf ("002:wait_time.tv_secs = %li, .tv_nsecs = %li\n", wait_time.tv_sec, wait_time.tv_nsec);*/ /*printf ("002:wait_time.tv_secs = %li, .tv_nsecs = %li\n", wait_time.tv_sec, wait_time.tv_nsec);*/