|
From: <sv...@va...> - 2008-06-28 16:55:33
|
Author: bart
Date: 2008-06-28 17:55:35 +0100 (Sat, 28 Jun 2008)
New Revision: 8304
Log:
Modified code such that concurrent pthread_cond_wait() and pthread_destroy() calls do no longer trigger an assertion failure in DRD.
Modified:
trunk/exp-drd/drd_cond.c
Modified: trunk/exp-drd/drd_cond.c
===================================================================
--- trunk/exp-drd/drd_cond.c 2008-06-28 16:47:22 UTC (rev 8303)
+++ trunk/exp-drd/drd_cond.c 2008-06-28 16:55:35 UTC (rev 8304)
@@ -252,16 +252,19 @@
}
p = cond_get(cond);
- // To do: print a proper error message if the assert below fails.
- tl_assert(p);
- // To do: print a proper error message if the assert below fails.
- tl_assert(p->waiter_count > 0);
- tl_assert(p->mutex);
- if (--p->waiter_count == 0)
+ if (p)
{
- p->mutex = 0;
+ if (p->waiter_count > 0)
+ {
+ --p->waiter_count;
+ if (p->waiter_count == 0)
+ {
+ p->mutex = 0;
+ }
+ }
+ return p->waiter_count;
}
- return p->waiter_count;
+ return 0;
}
static void cond_signal(Addr const cond)
|