Changeset 330 in flair-src for trunk/lib/FlairCore/src/Thread_impl.cpp
- Timestamp:
- Sep 25, 2019, 3:29:26 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/Thread_impl.cpp
r307 r330 276 276 } 277 277 278 int Thread_impl::WaitUpdate(const IODevice *device) {279 int status = 0;278 bool Thread_impl::WaitUpdate(const IODevice *device,Time timeout) { 279 bool status = true; 280 280 281 281 if (IsSuspended() == true) { 282 282 self->Err("thread is already supended\n"); 283 status = -1;283 status = false; 284 284 } else { 285 285 cond->GetMutex(); … … 287 287 if (device->pimpl_->SetToWake(self) == 0) { 288 288 is_suspended = true; 289 cond->CondWait(); 289 status=cond->CondWait(timeout); 290 if(status==false) device->pimpl_->SetToWake(NULL);//condwait timedout 290 291 is_suspended = false; 291 292 } 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; 295 295 } 296 296
Note:
See TracChangeset
for help on using the changeset viewer.