Author: bart
Date: 2008-02-17 09:21:05 +0000 (Sun, 17 Feb 2008)
New Revision: 7417

Log:
Fix exp-drd Fedora 8 tc18_semabuse regression test failure. It is okay to leave 
out the tl_assert(waited) statement because this statement is only triggered in 
case sem_post() fails, and sem_post() currently only fails when called on 
something that is not a semaphore.

Modified:
   trunk/exp-drd/drd_semaphore.c


Modified: trunk/exp-drd/drd_semaphore.c
===================================================================
--- trunk/exp-drd/drd_semaphore.c       2008-02-17 00:30:12 UTC (rev 7416)
+++ trunk/exp-drd/drd_semaphore.c       2008-02-17 09:21:05 UTC (rev 7417)
@@ -165,12 +165,15 @@
 void semaphore_post_post(const DrdThreadId tid, const Addr semaphore,
                          const SizeT size, const Bool waited)
 {
-  /* Note: it is hard to implement the sem_post() wrapper correctly if */
-  /* sem_post() can return an error code. The reason is that this would */
-  /* require to detect whether sem_post() will fail before sem_post is */
-  /* called -- p->vc may only be modified if the sem_post() call will */
-  /* succeed. */
-  tl_assert(waited);
+  /* Note: it is hard to implement the sem_post() wrapper correctly in     */
+  /* case sem_post() returns an error code. This is because handling this  */
+  /* case correctly requires restoring the vector clock associated with    */
+  /* the semaphore to its original value here. In order to do that without */
+  /* introducing a race condition, extra locking has to be added around    */
+  /* each semaphore call. Such extra locking would have to be added in     */
+  /* drd_intercepts.c. However, it is hard to implement synchronization    */
+  /* in drd_intercepts.c in a portable way without calling already         */
+  /* redirected functions.                                                 */
 }
 
 void semaphore_thread_delete(const DrdThreadId threadid)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to