From: Bart Van Assche Date: Sun, 17 Feb 2008 09:21:05 +0000 (+0000) Subject: Fix exp-drd Fedora 8 tc18_semabuse regression test failure. It is okay to leave out... X-Git-Tag: svn/VALGRIND_3_4_0~1061 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f828285af962d68aa6dfa6162cf14d8209b4df5f;p=thirdparty%2Fvalgrind.git 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. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7417 --- diff --git a/exp-drd/drd_semaphore.c b/exp-drd/drd_semaphore.c index ef28e71b7c..55c25e292a 100644 --- a/exp-drd/drd_semaphore.c +++ b/exp-drd/drd_semaphore.c @@ -165,12 +165,15 @@ void semaphore_pre_post(const DrdThreadId tid, const Addr semaphore, 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)