PERFORCE change 71660 for review
David Xu
davidxu at FreeBSD.org
Wed Feb 23 13:49:03 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=71660
Change 71660 by davidxu at davidxu_alona on 2005/02/23 13:49:01
Some style fixes.
Affected files ...
.. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_cond.c#14 edit
Differences ...
==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_cond.c#14 (text+ko) ====
@@ -105,8 +105,9 @@
int
_pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr)
{
+
*cond = NULL;
- return cond_init(cond, cond_attr);
+ return (cond_init(cond, cond_attr));
}
int
@@ -257,7 +258,8 @@
int
_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
- return cond_wait_common(cond, mutex, NULL, 0);
+
+ return (cond_wait_common(cond, mutex, NULL, 0));
}
__strong_reference(_pthread_cond_wait, _thr_cond_wait);
@@ -265,18 +267,20 @@
int
__pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
- return cond_wait_common(cond, mutex, NULL, 1);
+
+ return (cond_wait_common(cond, mutex, NULL, 1));
}
int
_pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex,
const struct timespec * abstime)
{
+
if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 ||
abstime->tv_nsec >= 1000000000)
return (EINVAL);
- return cond_wait_common(cond, mutex, abstime, 0);
+ return (cond_wait_common(cond, mutex, abstime, 0));
}
__strong_reference(_pthread_cond_timedwait, _thr_cond_timedwait);
@@ -285,11 +289,12 @@
__pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
const struct timespec *abstime)
{
+
if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 ||
abstime->tv_nsec >= 1000000000)
return (EINVAL);
- return cond_wait_common(cond, mutex, abstime, 1);
+ return (cond_wait_common(cond, mutex, abstime, 1));
}
static int
@@ -330,7 +335,8 @@
int
_pthread_cond_signal(pthread_cond_t * cond)
{
- return cond_signal_common(cond, 0);
+
+ return (cond_signal_common(cond, 0));
}
__strong_reference(_pthread_cond_signal, _thr_cond_signal);
@@ -338,7 +344,8 @@
int
_pthread_cond_broadcast(pthread_cond_t * cond)
{
- return cond_signal_common(cond, 1);
+
+ return (cond_signal_common(cond, 1));
}
__strong_reference(_pthread_cond_broadcast, _thr_cond_broadcast);
More information about the p4-projects
mailing list