  573

   

 pthread_cond_timedwait ()    -
        .
  .

(void) pthread_rnutex_lock (&t. inn);

t.waiters++ ;

clock_gettime (CLOCK_REALTIME, &ts) ;

ts.tv_sec += 5;

re = 0;

while (! mypredicate (&t) && re == 0)
re = pthread_cond_timedwait (&t.cond, &t.mn, &ts);

t.waiters--;

if (re == 0) setmystate (&t) ;

(void) pthread_mutex__unlock (&t.mn);

        
 ,      .  
     ,  
      .     
,        
      , 
   ,        .

 

.

 

pthread_cond_signal (), pthread_cond_broadcast (),  Base Definitions -
 IEEE Std 1003.1-2001, <pthread.h>.

  

     Issue 5.   
  POSIX Threads Extension.

Issue 6

 pthread_cond_timedwait()  pthread_cond_wait()  
  Threads.

    pthread_cond_wait ()   
 Open Group Corrigendum U021/9.

    IEEE Std 1003.1J-2000  ""  -
      Clock Selection.

  ""      [EPERM]    
 IEEE PASC Interpretation 1003.1 #28.

     ISO/IEC 9899: 1999   
pthread_cond_timedwait()  pthread_cond_wait ()   
 restrict.