Changeset 17:bcf16b0897fa in rrlib_thread


Ignore:
Timestamp:
26.01.2014 03:09:17 (6 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
13.10
Children:
18:72f585e63539, 22:8830afc9296c
Phase:
public
Message:

Fixed bugs that occured when 'application time' is set by an external entity

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tConditionVariable.cpp

    r15 r17  
    278278        std::lock_guard<std::mutex> l(rrlib::time::internal::tTimeMutex::Instance()); // this won't dead-lock, because this condition variable is not in listener list yet 
    279279        GetConditionVariableList()->push_back(this); 
     280        registered_in_list = true; 
    280281      } 
    281282      catch (const std::logic_error&) // tTimeMutex no longer exists 
  • tLoopThread.cpp

    r15 r17  
    105105 
    106106      // wait 
    107       rrlib::time::tTimestamp now = rrlib::time::Now(); 
     107      rrlib::time::tTimestamp now = local_use_application_time ? rrlib::time::Now() : rrlib::time::tBaseClock::now(); 
    108108      rrlib::time::tDuration last_cycle_time_tmp = now - last_cycle_start; 
    109109      last_cycle_time.Store(last_cycle_time_tmp); 
     
    135135      if (wait_for_x < rrlib::time::tDuration::zero()) 
    136136      { 
    137         last_cycle_start = rrlib::time::Now(); 
     137        last_cycle_start = local_use_application_time ? rrlib::time::Now() : rrlib::time::tBaseClock::now(); 
    138138      } 
    139139    } 
    140140    else 
    141141    { 
    142       last_cycle_start = rrlib::time::Now(); 
     142      last_cycle_start = use_application_time.load(std::memory_order_relaxed) ? rrlib::time::Now() : rrlib::time::tBaseClock::now(); 
    143143    } 
    144144 
Note: See TracChangeset for help on using the changeset viewer.