|
From: <sv...@va...> - 2008-11-17 17:35:31
|
Author: bart
Date: 2008-11-17 17:35:26 +0000 (Mon, 17 Nov 2008)
New Revision: 8776
Log:
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.
Modified:
trunk/drd/drd_barrier.c
Modified: trunk/drd/drd_barrier.c
===================================================================
--- trunk/drd/drd_barrier.c 2008-11-17 17:33:39 UTC (rev 8775)
+++ trunk/drd/drd_barrier.c 2008-11-17 17:35:26 UTC (rev 8776)
@@ -99,7 +99,6 @@
{
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 @@
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 @@
VG_(maybe_record_error)(VG_(get_running_tid)(),
BarrierErr,
VG_(get_IP)(VG_(get_running_tid)()),
- "Barrier reinitializatoin",
+ "Barrier reinitialization",
&bei);
}
}
|