From: Bart Van Assche Date: Mon, 17 Nov 2008 17:35:26 +0000 (+0000) Subject: Print an error message instead of asserting when the count argument of pthread_barrie... X-Git-Tag: svn/VALGRIND_3_4_0~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a2e5abe9ea5f42ff95b525f6e66014a3829e2e4;p=thirdparty%2Fvalgrind.git Print an error message instead of asserting when the count argument of pthread_barrier_init() is zero. Fixed a spelling error in an error message. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8776 --- diff --git a/drd/drd_barrier.c b/drd/drd_barrier.c index 542c610b0e..fd4ecfa3b1 100644 --- a/drd/drd_barrier.c +++ b/drd/drd_barrier.c @@ -99,7 +99,6 @@ void barrier_initialize(struct barrier_info* const p, { tl_assert(barrier != 0); tl_assert(barrier_type == pthread_barrier || barrier_type == gomp_barrier); - tl_assert(count > 0); tl_assert(p->a1 == barrier); p->cleanup = (void(*)(DrdClientobj*))barrier_cleanup; @@ -185,6 +184,16 @@ void barrier_init(const Addr barrier, tl_assert(barrier_type == pthread_barrier || barrier_type == gomp_barrier); + if (count == 0) + { + BarrierErrInfo bei = { barrier }; + VG_(maybe_record_error)(VG_(get_running_tid)(), + BarrierErr, + VG_(get_IP)(VG_(get_running_tid)()), + "pthread_barrier_init: 'count' argument is zero", + &bei); + } + if (! reinitialization && barrier_type == pthread_barrier) { p = barrier_get(barrier); @@ -194,7 +203,7 @@ void barrier_init(const Addr barrier, VG_(maybe_record_error)(VG_(get_running_tid)(), BarrierErr, VG_(get_IP)(VG_(get_running_tid)()), - "Barrier reinitializatoin", + "Barrier reinitialization", &bei); } }