summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>2008-04-26 00:54:52 +0000
committerjb <jb@FreeBSD.org>2008-04-26 00:54:52 +0000
commit52c14c7a3f5fbfa9c707a6206668a1eaa6c77a50 (patch)
treec98db398653c7c531756a3578af91819cb574281 /cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c
parentcb8ce777270daa16660da8e87ef6a11d5bc5408f (diff)
downloadFreeBSD-src-52c14c7a3f5fbfa9c707a6206668a1eaa6c77a50.zip
FreeBSD-src-52c14c7a3f5fbfa9c707a6206668a1eaa6c77a50.tar.gz
Vendor import of the full userland contrib part of DTrace support from
OpenSolaris. This commit resets files to match the versions in the OpenSolaris tree as of 2008/04/10. The changes in this import from the previous import are the ones that will subsequently re-applied to take files off the vendor branch. This is unfortunately necessary because the Solaris developers won't allow FreeBSD support #ifdefs in their source code because that creates 'dead code' (stuff that they never compile).
Diffstat (limited to 'cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c')
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c
index bc278b0..d91fbf4 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c
+++ b/cddl/contrib/opensolaris/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);
OpenPOWER on IntegriCloud