mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Correct example.
This commit is contained in:
@ -858,7 +858,7 @@ Modifications on @var{x} and @var{y} that may cause @var{x} to become greater th
|
|||||||
@smallexample
|
@smallexample
|
||||||
pthread_mutex_lock(&mut);
|
pthread_mutex_lock(&mut);
|
||||||
/* modify x and y */
|
/* modify x and y */
|
||||||
if (x > y) pthread_mutex_broadcast(&cond);
|
if (x > y) pthread_cond_broadcast(&cond);
|
||||||
pthread_mutex_unlock(&mut);
|
pthread_mutex_unlock(&mut);
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ and the time it waits on the condition variable.
|
|||||||
|cond|, as !pthread_cond_wait! does, but it also bounds the duration
|
|cond|, as !pthread_cond_wait! does, but it also bounds the duration
|
||||||
of the wait. If |cond| has not been signaled within the amount of time
|
of the wait. If |cond| has not been signaled within the amount of time
|
||||||
specified by |abstime|, the mutex |mutex| is re-acquired and
|
specified by |abstime|, the mutex |mutex| is re-acquired and
|
||||||
!pthread_cond_timedwait! returns the error !ETIMEDOUT!.
|
!pthread_cond_timedwait! returns the error !ETIMEDOUT!.
|
||||||
The |abstime| parameter specifies an absolute time, with the same
|
The |abstime| parameter specifies an absolute time, with the same
|
||||||
origin as !time!(2) and !gettimeofday!(2): an |abstime| of 0
|
origin as !time!(2) and !gettimeofday!(2): an |abstime| of 0
|
||||||
corresponds to 00:00:00 GMT, January 1, 1970.
|
corresponds to 00:00:00 GMT, January 1, 1970.
|
||||||
@ -190,7 +190,7 @@ Modifications on |x| and |y| that may cause |x| to become greater than
|
|||||||
.sp
|
.sp
|
||||||
pthread_mutex_lock(&mut);
|
pthread_mutex_lock(&mut);
|
||||||
/* modify x and y */
|
/* modify x and y */
|
||||||
if (x > y) pthread_mutex_broadcast(&cond);
|
if (x > y) pthread_cond_broadcast(&cond);
|
||||||
pthread_mutex_unlock(&mut);
|
pthread_mutex_unlock(&mut);
|
||||||
.ft
|
.ft
|
||||||
.LP
|
.LP
|
||||||
@ -232,4 +232,3 @@ pthread_mutex_unlock(&mut);
|
|||||||
.LP
|
.LP
|
||||||
.RE
|
.RE
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user