566  

 

                pthread_cond_destroy ()
Hpthread_cond_init()   ;    
,   .

      [EBUSY]  [EINVAL]  
(  ),         
,           -
  ,   cond.



 pthread_cond_destroy ()   , :

[EBUSY]        ,  -
 cond,      (,
    pthread_cond_wait () 
pthread_cond_timedwait());

[EINVAL]   ,   cond, .
 pthread_cond_init ()  , :

[EAGAIN]        (    ),
      ;

[ENOMEM]        -
 .

 pthread_cond_init ()   , :

[EBUSY]         
 ,   cond,   -
 ,    ;

[EINVAL]   ,   attr, .



      ,    
,   . , ,  .

struct list {

pthread_mutex_t 1m;

}
struct eit {

key k;

int busy;

pthread_cond_t notbusy;

}

/*      . */

struct eit *

list_find (struct list *lp, key k)

{

struct eit *ep;

pthread_mutex_lock (&lp->lm);