summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_barrier.c
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committersjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit65145fa4c81da358fcbc3b650156dab705dfa34e (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /lib/libthr/thread/thr_barrier.c
parent60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff)
parente6b664c390af88d4a87208bc042ce503da664c3b (diff)
downloadFreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip
FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz
Merge sync of head
Diffstat (limited to 'lib/libthr/thread/thr_barrier.c')
-rw-r--r--lib/libthr/thread/thr_barrier.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_barrier.c b/lib/libthr/thread/thr_barrier.c
index 86f880e..10b6346 100644
--- a/lib/libthr/thread/thr_barrier.c
+++ b/lib/libthr/thread/thr_barrier.c
@@ -86,16 +86,13 @@ _pthread_barrier_init(pthread_barrier_t *barrier,
if (barrier == NULL || count <= 0)
return (EINVAL);
- bar = malloc(sizeof(struct pthread_barrier));
+ bar = calloc(1, sizeof(struct pthread_barrier));
if (bar == NULL)
return (ENOMEM);
_thr_umutex_init(&bar->b_lock);
_thr_ucond_init(&bar->b_cv);
- bar->b_cycle = 0;
- bar->b_waiters = 0;
bar->b_count = count;
- bar->b_refcount = 0;
*barrier = bar;
return (0);
OpenPOWER on IntegriCloud