568  



pthread_cond_timedwait, pthread_cond_wait    .



THR   #include <pthread.h>

int pthread_cond_timedwait (

pthread_cond_t *restrict cond,

pthread_mutex_t *restrict mutex,

const struct timespec *restrict abstime) ;

int pthread_cond_wait (pthread_cond_t *restrict cond,

pthread_mutex_t *restrict mutex);



 pthread_cond_timedwait ()  pthread_cond_wait () 
     .    -
  mutex,   ;    -
   .

     mutex  
        cond;

""   "     
       ".  -
,  -        -
  ,     
pthread_cond_broadcast ()  pthread_cond_signal ()   () -
  ,          .

     ,     -
 .

       , -
   ,     
.    ,     -
.            pthread_cond_timedwait ()   
pthread_cond_wait ()   .    
   ,      -
,         .

       -
 pthread_cond_timedwait ()  pthread_cond_wait ()      -
   ;  ,    
 ,       -
,   ()      .

  (  )   " -
".        
PTHREAD_CANCEL_DEFERRED,   ,   -
          -