Changeset 330 in flair-src for trunk/lib/FlairCore/src/Thread_impl.cpp


Ignore:
Timestamp:
Sep 25, 2019, 3:29:26 PM (5 years ago)
Author:
Sanahuja Guillaume
Message:

use less bandwidth in vprnlite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/Thread_impl.cpp

    r307 r330  
    276276}
    277277
    278 int Thread_impl::WaitUpdate(const IODevice *device) {
    279   int status = 0;
     278bool Thread_impl::WaitUpdate(const IODevice *device,Time timeout) {
     279  bool status = true;
    280280
    281281  if (IsSuspended() == true) {
    282282    self->Err("thread is already supended\n");
    283     status = -1;
     283    status = false;
    284284  } else {
    285285    cond->GetMutex();
     
    287287    if (device->pimpl_->SetToWake(self) == 0) {
    288288      is_suspended = true;
    289       cond->CondWait();
     289      status=cond->CondWait(timeout);
     290      if(status==false) device->pimpl_->SetToWake(NULL);//condwait timedout
    290291      is_suspended = false;
    291292    } else {
    292       self->Err("%s is already waiting an update\n",
    293                 device->ObjectName().c_str());
    294       status = -1;
     293      self->Err("%s is already waiting an update\n", device->ObjectName().c_str());
     294      status = false;
    295295    }
    296296
Note: See TracChangeset for help on using the changeset viewer.