Analysis of muduo library - base (5) Condition

It's all pretty basic stuff, so I won't go into too much detail.


void wait()
  {
    MutexLock::UnassignGuard ug(mutex_); //Unbind thread and lock when waiting
    MCHECK(pthread_cond_wait(&pcond_, mutex_.getPthreadMutex()));
  }
ETIMEDOUT == pthread_cond_timedwait(&pcond_, mutex_.getPthreadMutex(), &abstime); //After waiting for a period of time, the difference between return and wait has a time limit


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325801312&siteId=291194637