Andra Hugo 13 years ago
parent
commit
bc5d989c60

+ 1 - 1
doc/chapters/c-extensions.texi

@@ -46,7 +46,7 @@ plug-in.  It does not require detailed knowledge of the StarPU library.
 Note: as of StarPU @value{VERSION}, this is still an area under
 development and subject to change.
 
-  @menu
+@menu
 * Defining Tasks::              Defining StarPU tasks
 * Synchronization and Other Pragmas:: Synchronization, and more.
 * Registered Data Buffers::     Manipulating data buffers

+ 50 - 0
include/starpu_config.h.in

@@ -35,6 +35,7 @@
 #undef STARPU_MKL
 #undef STARPU_SYSTEM_BLAS
 
+<<<<<<< .working
 #undef STARPU_BUILD_DIR
 #undef STARPU_OPENCL_DATADIR
 #undef STARPU_HAVE_MAGMA
@@ -83,6 +84,55 @@ typedef long starpu_ssize_t;
 #  include <sys/types.h>
 typedef ssize_t starpu_ssize_t;
 #define __starpu_func__ __func__
+=======
+#undef STARPU_BUILD_DIR
+#undef STARPU_OPENCL_DATADIR
+#undef STARPU_HAVE_MAGMA
+
+#undef STARPU_OPENGL_RENDER
+#undef STARPU_USE_GTK
+#undef STARPU_HAVE_X11
+
+#undef STARPU_HAVE_POSIX_MEMALIGN
+
+#undef STARPU_HAVE_MEMALIGN
+
+#undef STARPU_HAVE_MALLOC_H
+
+#undef STARPU_HAVE_SYNC_BOOL_COMPARE_AND_SWAP
+#undef STARPU_HAVE_SYNC_FETCH_AND_ADD
+#undef STARPU_HAVE_SYNC_FETCH_AND_OR
+#undef STARPU_HAVE_SYNC_LOCK_TEST_AND_SET
+
+#undef STARPU_MODEL_DEBUG
+#undef STARPU_NO_ASSERT
+
+#undef STARPU_HAVE_FFTW
+#undef STARPU_HAVE_FFTWF
+#undef STARPU_HAVE_FFTWL
+
+#undef STARPU_HAVE_CURAND
+
+#undef STARPU_MAXNODES
+#undef STARPU_NMAXBUFS
+#undef STARPU_MAXCPUS
+#undef STARPU_MAXCUDADEVS
+#undef STARPU_MAXOPENCLDEVS
+#undef STARPU_NMAXWORKERS
+#undef STARPU_MAXIMPLEMENTATIONS
+
+#undef STARPU_HAVE_LIBNUMA
+
+#undef STARPU_HAVE_WINDOWS
+
+#ifdef _MSC_VER
+typedef long starpu_ssize_t;
+#define __starpu_func__ __FUNCTION__
+#else
+#  include <sys/types.h>
+typedef ssize_t starpu_ssize_t;
+#define __starpu_func__ __func__
+>>>>>>> .merge-right.r6401
 #endif
 
 #undef STARPU_SLOW_MACHINE

+ 1 - 0
src/Makefile.am

@@ -235,3 +235,4 @@ endif
 
 showcheck:
 	-cat /dev/null
+

+ 1 - 0
src/common/fxt.h

@@ -394,3 +394,4 @@ do {										\
 #endif // STARPU_USE_FXT
 
 #endif // __FXT_H__
+

+ 1 - 0
src/core/dependencies/implicit_data_deps.c

@@ -504,3 +504,4 @@ int _starpu_data_wait_until_available(starpu_data_handle_t handle, enum starpu_a
 
 	return 0;
 }
+

+ 1 - 0
src/core/jobs.c

@@ -438,3 +438,4 @@ const char *_starpu_get_model_name(struct _starpu_job *j)
 #endif
         }
 }
+

+ 1 - 0
src/core/jobs.h

@@ -175,3 +175,4 @@ int _starpu_push_local_task(struct _starpu_worker *worker, struct starpu_task *t
 const char *_starpu_get_model_name(struct _starpu_job *j);
 
 #endif // __JOBS_H__
+

+ 1 - 0
src/core/sched_policy.c

@@ -662,3 +662,4 @@ int starpu_push_local_task(int workerid, struct starpu_task *task, int back)
 	return _starpu_push_local_task(worker, task, back);
 }
 
+

+ 1 - 0
src/core/sched_policy.h

@@ -46,3 +46,4 @@ struct starpu_task *_starpu_create_conversion_task(starpu_data_handle_t handle,
 void _starpu_sched_pre_exec_hook(struct starpu_task *task);
 
 #endif // __SCHED_POLICY_H__
+

+ 1 - 0
src/core/task.c

@@ -759,3 +759,4 @@ starpu_gordon_func_t _starpu_task_get_gordon_nth_implementation(struct starpu_co
 	STARPU_ASSERT(cl->gordon_func == STARPU_MULTIPLE_GORDON_IMPLEMENTATIONS);
 	return cl->gordon_funcs[nimpl];
 }
+

+ 1 - 0
src/core/task.h

@@ -74,3 +74,4 @@ starpu_opencl_func_t _starpu_task_get_opencl_nth_implementation(struct starpu_co
 starpu_gordon_func_t _starpu_task_get_gordon_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
 
 #endif // __CORE_TASK_H__
+

+ 1 - 0
src/core/topology.c

@@ -879,3 +879,4 @@ void _starpu_destroy_topology(struct _starpu_machine_config *config __attribute_
 	may_bind_automatically = 0;
 #endif
 }
+

+ 1 - 0
src/core/workers.c

@@ -909,3 +909,4 @@ void _starpu_worker_set_status(int workerid, enum _starpu_worker_status status)
 struct _starpu_sched_ctx* _starpu_get_initial_sched_ctx(void){
 	return &config.sched_ctxs[0];
 }
+

+ 1 - 0
src/core/workers.h

@@ -235,3 +235,4 @@ unsigned _starpu_execute_registered_progression_hooks(void);
 struct _starpu_sched_ctx* _starpu_get_initial_sched_ctx(void);
 
 #endif // __WORKERS_H__
+

+ 1 - 0
src/datawizard/filters.c

@@ -446,3 +446,4 @@ static void starpu_data_create_children(starpu_data_handle_t handle, unsigned nc
 	/* this handle now has children */
 	handle->nchildren = nchildren;
 }
+

+ 1 - 0
src/datawizard/reduction.c

@@ -349,3 +349,4 @@ void _starpu_data_end_reduction_mode_terminate(starpu_data_handle_t handle)
 		}
 	}
 }
+

+ 1 - 0
src/datawizard/user_interactions.c

@@ -497,3 +497,4 @@ void starpu_data_query_status(starpu_data_handle_t handle, int memory_node, int
 
 //	_starpu_spin_unlock(&handle->header_lock);
 }
+

+ 1 - 0
src/debug/traces/starpu_fxt.c

@@ -1340,3 +1340,4 @@ void starpu_fxt_generate_trace(struct starpu_fxt_options *options)
 	options->nworkers = nworkers;
 }
 #endif // STARPU_USE_FXT
+

+ 1 - 0
src/debug/traces/starpu_paje.c

@@ -246,3 +246,4 @@ void _starpu_fxt_write_paje_header(FILE *file)
 }
 
 #endif
+

+ 1 - 0
src/sched_policies/parallel_heft.c

@@ -601,3 +601,4 @@ struct starpu_sched_policy _starpu_sched_parallel_heft_policy =
 	.policy_name = "pheft",
 	.policy_description = "parallel HEFT"
 };
+

+ 1 - 0
src/sched_policies/random_policy.c

@@ -143,3 +143,4 @@ struct starpu_sched_policy _starpu_sched_random_policy =
 	.policy_name = "random",
 	.policy_description = "weighted random"
 };
+

+ 3 - 1
starpu-1.0.pc.in

@@ -29,7 +29,9 @@ Name: starpu
 Description: offers support for heterogeneous multicore architecture
 Version: @PACKAGE_VERSION@
 Cflags: -I${includedir}/starpu/@STARPU_EFFECTIVE_VERSION@ @STARPU_CUDA_CPPFLAGS@
-Libs: -L${libdir} -lstarpu-@STARPU_EFFECTIVE_VERSION@ @STARPU_CUDA_LDFLAGS@ @STARPU_OPENCL_LDFLAGS@ @STARPU_SCHED_CTX_HYPERVISOR@
+Libs: -L${libdir} -lstarpu-@STARPU_EFFECTIVE_VERSION@
+@STARPU_CUDA_LDFLAGS@ @STARPU_OPENCL_LDFLAGS@
+@STARPU_SCHED_CTX_HYPERVISOR@
 Libs.private: @LDFLAGS@ @LIBS@
 Requires: @HWLOC_REQUIRES@
 Requires.private: @GORDON_REQUIRES@

+ 95 - 0
tools/dev/experimental/cpu_func_to_cpu_funcs.cocci

@@ -0,0 +1,95 @@
+// StarPU --- Runtime system for heterogeneous multicore architectures.
+//
+// Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
+//
+// StarPU is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation; either version 2.1 of the License, or (at
+// your option) any later version.
+//
+// StarPU is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+//
+// See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+// $ spatch -sp_file cpu_func_to_cpu_funcs.cocci cpu_func_to_cpu_funcs_test.c
+
+///////////////////////////////////////////////////////////////////////////////
+// There is no need to specify STARPU_MULTIPLE_CPU_IMPLEMENTATIONS any more. //
+// XXX : We must find a way to make sure cpu_funcs is NULL-terminated.       //
+///////////////////////////////////////////////////////////////////////////////
+@@
+identifier cl;
+@@
+struct starpu_codelet cl = {
+-	.cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
+	.cpu_funcs = { ...
+- }
++ ,NULL}
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// The previous rule may have added "NULL" twice in the initialization of the //
+// cpu_funcs field. Let's take care of that.                                  //
+////////////////////////////////////////////////////////////////////////////////
+@@
+identifier cl;
+@@
+struct starpu_codelet cl = {
+	.cpu_funcs = { ..., NULL
+- ,NULL
+}
+};
+
+
+////////////////////////////////////////////////////
+// Find all the codelets using the cpu_func field //
+////////////////////////////////////////////////////
+@cpu_func@
+expression f;
+identifier cl;
+@@
+struct starpu_codelet cl = {
+	.cpu_func = f
+};
+
+
+
+///////////////////////////////////////////////////////////////////
+// Find all the codelets that define both cpu_func and cpu_funcs //
+///////////////////////////////////////////////////////////////////
+@cpu_funcs depends on cpu_func@
+expression cpu_func.f;
+identifier cpu_func.cl;
+@@
+struct starpu_codelet cl = {
+	.cpu_funcs = { f, NULL }
+};
+
+
+//////////////////////////////////////////////////////////////////////////////
+// For codelets that define cpu_func but not cpu_funcs, remove cpu_func and //
+// add cpu_funcs                                                            //
+//////////////////////////////////////////////////////////////////////////////
+@depends on !cpu_funcs@
+identifier cpu_func.cl;
+expression cpu_func.f;
+@@
+struct starpu_codelet cl = {
+-	.cpu_func = f
++	.cpu_funcs = { f, NULL }
+};
+
+
+/////////////////////////////////////////////////////////////////
+// If both cpu_func and cpu_funcs are defined, remove cpu_func //
+/////////////////////////////////////////////////////////////////
+@depends on cpu_funcs@
+identifier cpu_func.cl;
+expression cpu_func.f;
+@@
+struct starpu_codelet cl = {
+-	.cpu_func = f
+};

+ 59 - 0
tools/dev/experimental/cpu_func_to_cpu_funcs_test.c

@@ -0,0 +1,59 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2011  Institut National de Recherche en Informatique et Automatique
+ *
+ * StarPU is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#include <stdio.h>
+#include <sdtdlib.h>
+#include "lol.h"
+
+/*
+ * Old format
+ */
+struct starpu_codelet cl1 = {
+	.where = STARPU_CPU,
+	.cpu_func = foo
+};
+
+/*
+ * New format : it must not be changed !
+ */
+struct starpu_codelet cl2 = {
+	.cpu_funcs = {foo, NULL}
+};
+
+/*
+ * Maybe we added the cpu_funcs fields, but forgot to remove the cpu_func one.
+ */
+struct starpu_codelet cl3 = {
+	.cpu_func = foo,
+	.cpu_funcs = { foo, NULL }
+};
+
+/*
+ * Old multiimplementations format, but not terminated by NULL
+ * XXX : NULL is not added.
+ */
+struct starpu_codelet cl4 = {
+	.cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
+	.cpu_funcs = { foo, bar }
+};
+
+/*
+ * Old multiimplementations format, terminated by NULL
+ */
+struct starpu_codelet cl5 = {
+	.cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
+	.cpu_funcs = { foo, bar, NULL }
+};

+ 34 - 0
tools/dev/experimental/remove_where_field.cocci

@@ -0,0 +1,34 @@
+// StarPU --- Runtime system for heterogeneous multicore architectures.
+//
+// Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
+//
+// StarPU is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation; either version 2.1 of the License, or (at
+// your option) any later version.
+//
+// StarPU is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+//
+// See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+@@
+identifier c;
+expression E;
+@@
+struct starpu_codelet c = {
+-	.where = E
+};
+
+@@
+struct starpu_codelet cl;
+expression E;
+@@
+-cl.where = E;
+
+@@
+struct starpu_codelet*  pointer_to_cl;
+expression E;
+@@
+- pointer_to_cl->where = E;

+ 42 - 0
tools/dev/experimental/remove_where_field_test.c

@@ -0,0 +1,42 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2011  Institut National de Recherche en Informatique et Automatique
+ *
+ * StarPU is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+struct dummy_struct
+{
+	int where;
+};
+
+
+/* Simple example : remove the where field */
+struct starpu_codelet cl = {
+	.cuda_func = bar,
+	.where = STARPU_CPU | STARPU_OPENCL,
+	.cpu_func = foo
+};
+
+
+void
+dummy(void)
+{
+	cl.where = STARPU_CUDA;
+	starpu_codelet_t *clp = &cl;
+	clp->where = STARPU_CPU; /* Must be removed */
+
+	struct dummy_struct ds;
+	struct dummy_struct *dsp = &ds;
+	ds.where = 12;   /* Must not be removed */
+	dsp->where = 12; /* Must not be removed */ 
+}

+ 54 - 0
tools/dev/experimental/test_return_values.cocci

@@ -0,0 +1,54 @@
+// StarPU --- Runtime system for heterogeneous multicore architectures.
+//
+// Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
+//
+// StarPU is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation; either version 2.1 of the License, or (at
+// your option) any later version.
+//
+// StarPU is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+//
+// See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+// I have no idea in Hell why we need "<... ...>", but this will not work with
+// "... ..."
+@@
+@@
+main(...)
+{
+<...
+-	return 0;
++	return EXIT_SUCCESS;
+...>
+}
+
+
+//
+// Is (..)*/common/helper.h included ?
+// XXX : OK, that suxx, but it should work. Is there a way to use a regular
+// expression to match a header ?
+@helper_included@
+@@
+(
+#include "common/helper.h"
+|
+#include "../common/helper.h"
+|
+#include "../../common/helper.h"
+|
+#include "../../../common/helper.h"
+)
+
+
+@depends on helper_included@
+@@
+main(...)
+{
+...
+-	return 77;
++	return STARPU_TEST_SKIPPED;
+...
+}

+ 20 - 0
tools/dev/experimental/test_return_values.sh

@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2011  Centre National de la Recherche Scientifique
+#
+# StarPU is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# StarPU is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+dir=${1:-.}
+
+find $dir -name "*.c" -exec spatch -in_place -very_quiet -sp_file tools/dev/experimental/test_return_values.cocci {} \;

+ 20 - 0
tools/dev/experimental/use_starpu_macros.sh

@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2011  Centre National de la Recherche Scientifique
+#
+# StarPU is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# StarPU is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+dir=${1:-.}
+
+find $dir -name "*.c" -exec spatch -in_place -very_quiet -sp_file tools/dev/experimental/use_starpu_macros.cocci {} \;

+ 116 - 0
tools/dev/experimental/use_starpu_macros_test.c

@@ -0,0 +1,116 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2011  Institut National de Recherche en Informatique et Automatique
+ *
+ * StarPU is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+static void
+foo(void)
+{
+	abort(); /* STARPU_ABORT() */
+}
+
+static void
+bar(struct starpu_task *task)
+{
+	assert(task && task->cl); /* STARPU_ASSERT(task && task->cl) */
+}
+
+/*
+ * STARPU_MIN
+ */
+static int
+min(int a, int b)
+{
+	return a<b?a:b; /* return STARPU_MIN(a, b); */
+}
+
+static int
+min2(int a, int b)
+{
+	int res;
+	res = a<b?a:b; /* res = STARPU_MIN(a,b); */
+	return res;
+}
+
+static int
+min3(int a, int b)
+{
+	int res = a<b?a:b; /* int res = a<b?a:b; */
+	return res;
+}
+
+static int
+min4(int a, int b)
+{
+	return a>b?b:a; /* return STARPU_MIN(a,b); */
+}
+
+static int
+min5(int a, int b)
+{
+	int res;
+	res = a>b?b:a; /* res = STARPU_MIN(a,b); */
+}
+
+static int
+min6(int a, int b)
+{
+	int res = a>b?b:a; /* int res = STARPU_MIN(a, b); */
+	return res;
+}
+
+/*
+ * STARPU_MAX
+ */
+static int
+max(int a, int b)
+{
+	return a<b?b:a; /* return STARPU_MAX(a, b); */
+}
+
+static int
+max2(int a, int b)
+{
+	int res;
+	res = a<b?b:a; /* res = STARPU_MAX(a, b); */
+	return res;
+}
+
+static int
+max3(int a, int b)
+{
+	int res = a<b?b:a; /* int res = STARPU_MAX(a, b); */
+	return res;
+}
+
+static int
+max4(int a, int b)
+{
+	return a>b?a:b; /* return STARPU_MAX(a, b); */
+}
+
+static int
+max5(int a, int b)
+{
+	int res;
+	res = a>b?a:b; /* res = STARPU_MAX(a, b); */
+	return res;
+}
+
+static int
+max6(int a, int b)
+{
+	int res = a>b?a:b; /* int res = STARPU_MAX(a, b); */
+	return res;
+}

+ 20 - 0
tools/dev/experimental/use_starpu_pthread_macros.sh

@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2011  Centre National de la Recherche Scientifique
+#
+# StarPU is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# StarPU is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+dir=${1:-.}
+
+find $dir -name "*.c" -exec spatch -in_place -very_quiet -sp_file tools/dev/experimental/use_starpu_pthread_macros.cocci {} \;

+ 24 - 0
tools/dev/experimental/use_starpu_pthread_macros_test.c

@@ -0,0 +1,24 @@
+static void
+foo(void)
+{
+	pthread_mutex_init(&mutex, NULL);
+	pthread_mutex_lock(&mutex);
+	pthread_mutex_unlock(&mutex);
+	pthread_mutex_destroy(&mutex);
+
+	pthread_rwlock_init(&rwlock);
+	pthread_rwlock_rdlock(&rwlock);
+	pthread_rwlock_wrlock(&rwlock);
+	pthread_rwlock_unlock(&rwlock);
+	pthread_rwlock_destroy(&rwlock);
+
+	pthread_cond_init(&cond, NULL);
+	pthread_cond_signal(&cond);
+	pthread_cond_broadcast(&cond);
+	pthread_cond_wait(&cond, &mutex);
+	pthread_cond_destroy(&cond);
+
+	pthread_barrier_init(&barrier, NULL, 42);
+	pthread_barrier_wait(&barrier);
+	pthread_barrier_destroy(&barrier);
+}