Changeset 42:222fb8b97560 in finroc_plugins_rpc_ports


Ignore:
Timestamp:
24.09.2017 18:09:40 (15 months ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Phase:
public
Tags:
tip
Message:

Makes rpc_ports plugin compile in single-threaded mode (by using rrlib::thread::tConditionVariable instead of std::condition_variable)

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • internal/tCallStorage.cpp

    r11 r42  
    7373  empty(true), 
    7474  mutex(), 
    75   condition_variable(), 
     75  condition_variable(mutex), 
    7676  waiting(false), 
    7777  future_status((int)tFutureStatus::PENDING), 
     
    122122  rrlib::thread::tLock lock(mutex); 
    123123  future_status.store((int)new_status); 
    124   condition_variable.notify_one(); 
     124  condition_variable.Notify(lock); 
    125125  if (response_handler) 
    126126  { 
  • internal/tCallStorage.h

    r32 r42  
    316316 
    317317  /*! Condition variable for thread synchronization */ 
    318   std::condition_variable condition_variable; 
     318  rrlib::thread::tConditionVariable condition_variable; 
    319319 
    320320  /*! True while thread is waiting on condition variable */ 
  • internal/tRPCRequest.h

    r27 r42  
    172172    result_buffer = std::move(return_value); 
    173173    storage.future_status.store((int)tFutureStatus::READY); 
    174     storage.condition_variable.notify_one(); 
     174    storage.condition_variable.Notify(lock); 
    175175    if (storage.response_handler) 
    176176    { 
  • internal/tRPCResponse.h

    r27 r42  
    185185    result_buffer = std::move(return_value); 
    186186    storage.future_status.store((int)tFutureStatus::READY); 
    187 //    storage.condition_variable.notify_one(); 
     187//    storage.condition_variable.Notify(); 
    188188//    if (storage.response_handler) 
    189189//    { 
  • tFuture.h

    r11 r42  
    153153        } 
    154154        storage->waiting = true; 
    155         std::cv_status cv_status = storage->condition_variable.wait_for(lock.GetSimpleLock(), timeout); 
     155        auto cv_status = storage->condition_variable.Wait(lock, timeout, false); 
    156156        storage->waiting = false; 
    157         if (cv_status == std::cv_status::timeout) 
     157        if (cv_status == rrlib::thread::tConditionVariableStatus::TIMEOUT) 
    158158        { 
    159159          throw tRPCException(tFutureStatus::TIMEOUT); 
  • tPromise.h

    r15 r42  
    169169    *result_buffer = std::move(value); 
    170170    storage->future_status.store((int)tFutureStatus::READY); 
    171     storage->condition_variable.notify_one(); 
     171    storage->condition_variable.Notify(lock); 
    172172    if (storage->response_handler) 
    173173    { 
     
    192192    *result_buffer = value; 
    193193    storage->future_status.store((int)tFutureStatus::READY); 
    194     storage->condition_variable.notify_one(); 
     194    storage->condition_variable.Notify(lock); 
    195195    if (storage->response_handler) 
    196196    { 
Note: See TracChangeset for help on using the changeset viewer.