Changeset 26:7e49f8bf5ff5 in rrlib_thread


Ignore:
Timestamp:
28.04.2014 21:40:00 (6 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
13.10
Phase:
public
Message:

Better error messages in case of clock inconsistency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tLoopThread.cpp

    r24 r26  
    109109      if (last_cycle_time_tmp.count() < 0) 
    110110      { 
    111         RRLIB_LOG_PRINT(WARNING, "Clock inconsistency detected: Last cycle started ", rrlib::time::ToString(-last_cycle_time_tmp), " \"after\" this cycle."); 
     111        if (-last_cycle_time_tmp <= cycle_time) 
     112        { 
     113          RRLIB_LOG_PRINT(WARNING, "Early thread wakeup detected"); 
     114        } 
     115        else 
     116        { 
     117          RRLIB_LOG_PRINT(WARNING, "Clock inconsistency detected: According to clock, current cycle started ", rrlib::time::ToString(-last_cycle_time_tmp), " before it should have. This would have been before the last cycle."); 
     118        } 
     119 
    112120        last_cycle_start = now; 
    113121        if (last_wait > rrlib::time::tDuration::zero()) 
    114122        { 
    115           RRLIB_LOG_PRINT(WARNING, "Waiting for ", rrlib::time::ToString(last_wait), ", as in last cycle, instead."); 
     123          RRLIB_LOG_PRINT(WARNING, "Waiting for ", rrlib::time::ToString(last_wait), ", as in last cycle."); 
    116124          Sleep(last_wait, local_use_application_time); 
    117125        } 
Note: See TracChangeset for help on using the changeset viewer.