Changeset 1083

Show
Ignore:
Timestamp:
05/01/08 12:09:32 (13 years ago)
Author:
ppalmers
Message:

reduce verbosity of logging. re-enable the use of clock_nanosleep.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/config.h.in

    r1081 r1083  
    8080 
    8181// we should be using absolute clock_nanosleep 
    82 // but on my system it causes a lockup
    83 #define USE_ABSOLUTE_NANOSLEEP 0 
     82// but on my system it causes a problem on shutdown
     83#define USE_ABSOLUTE_NANOSLEEP 1 
    8484 
    8585// 1394 service constants  
  • trunk/libffado/src/libutil/SystemTimeSource.cpp

    r1081 r1083  
    5454    ts.tv_sec = wake_at_usec / (1000000LL); 
    5555    ts.tv_nsec = (wake_at_usec % (1000000LL)) * 1000LL; 
    56     debugOutput(DEBUG_LEVEL_VERBOSE, 
     56    debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
    5757                "clock_nanosleep until %lld sec, %lld nanosec\n", 
    5858                (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 
    5959    int err = clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL); 
    60     debugOutput(DEBUG_LEVEL_VERBOSE, 
     60    debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
    6161                "back with err=%d\n", 
    6262                err); 
    6363#else 
    64     ffado_microsecs_t to_sleep = wake_at_usec - getCurrentTime(); 
    65     SleepUsecRelative(to_sleep); 
     64    // only sleep if needed 
     65    ffado_microsecs_t now = getCurrentTime(); 
     66    if(wake_at_usec >= now) { 
     67        ffado_microsecs_t to_sleep = wake_at_usec - now; 
     68        SleepUsecRelative(to_sleep); 
     69    } 
    6670#endif 
    6771}