summaryrefslogtreecommitdiff
path: root/tools/ctf/cvt/barrier.c
diff options
context:
space:
mode:
authorJohn Birrell <jb@FreeBSD.org>2008-04-26 00:54:52 +0000
committerJohn Birrell <jb@FreeBSD.org>2008-04-26 00:54:52 +0000
commit275928fc142e604d7d091feb5eff54c72f241964 (patch)
tree8ca775b7063efa797f34e76afbae30ecb5cb3dc9 /tools/ctf/cvt/barrier.c
parent2de84d2572206157cf33d1fb75463eeb42ae8e42 (diff)
Diffstat (limited to 'tools/ctf/cvt/barrier.c')
-rw-r--r--tools/ctf/cvt/barrier.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/tools/ctf/cvt/barrier.c b/tools/ctf/cvt/barrier.c
index bc278b063de1a..d91fbf44db070 100644
--- a/tools/ctf/cvt/barrier.c
+++ b/tools/ctf/cvt/barrier.c
@@ -38,9 +38,7 @@
*/
#include <pthread.h>
-#if defined(sun)
#include <synch.h>
-#endif
#include <stdio.h>
#include "barrier.h"
@@ -49,11 +47,7 @@ void
barrier_init(barrier_t *bar, int nthreads)
{
pthread_mutex_init(&bar->bar_lock, NULL);
-#if defined(sun)
sema_init(&bar->bar_sem, 0, USYNC_THREAD, NULL);
-#else
- sem_init(&bar->bar_sem, 0, 0);
-#endif
bar->bar_numin = 0;
bar->bar_nthr = nthreads;
@@ -66,11 +60,7 @@ barrier_wait(barrier_t *bar)
if (++bar->bar_numin < bar->bar_nthr) {
pthread_mutex_unlock(&bar->bar_lock);
-#if defined(sun)
sema_wait(&bar->bar_sem);
-#else
- sem_wait(&bar->bar_sem);
-#endif
return (0);
@@ -80,11 +70,7 @@ barrier_wait(barrier_t *bar)
/* reset for next use */
bar->bar_numin = 0;
for (i = 1; i < bar->bar_nthr; i++)
-#if defined(sun)
sema_post(&bar->bar_sem);
-#else
- sem_post(&bar->bar_sem);
-#endif
pthread_mutex_unlock(&bar->bar_lock);
return (1);