summaryrefslogtreecommitdiff
path: root/components/libc/pthreads/pthread_cond.c
diff options
context:
space:
mode:
authorluo jiao <[email protected]>2017-12-22 13:24:02 +0800
committerluo jiao <[email protected]>2017-12-22 13:24:02 +0800
commit3d65afc7d5c0e606712ecf90abb08f2edc159dfa (patch)
treed9fb4f192e50738a7103d84e16d701b3d5ac3466 /components/libc/pthreads/pthread_cond.c
parent31151a775a32da61c1a3252c7f0684411f38ab80 (diff)
add some parameter check and function defintion etc.
Diffstat (limited to 'components/libc/pthreads/pthread_cond.c')
-rw-r--r--components/libc/pthreads/pthread_cond.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/libc/pthreads/pthread_cond.c b/components/libc/pthreads/pthread_cond.c
index 25628fc2b3..9349e84050 100644
--- a/components/libc/pthreads/pthread_cond.c
+++ b/components/libc/pthreads/pthread_cond.c
@@ -137,6 +137,9 @@ RTM_EXPORT(pthread_cond_destroy);
int pthread_cond_broadcast(pthread_cond_t *cond)
{
rt_err_t result;
+
+ if (cond == RT_NULL)
+ return EINVAL;
if (cond->attr == -1)
pthread_cond_init(cond, RT_NULL);
@@ -173,6 +176,8 @@ int pthread_cond_signal(pthread_cond_t *cond)
{
rt_err_t result;
+ if (cond == RT_NULL)
+ return EINVAL;
if (cond->attr == -1)
pthread_cond_init(cond, RT_NULL);