|
From: Julian S. <js...@ac...> - 2012-08-24 19:10:30
|
Bart, do you want this in 3.8.1? If yes just let me know and I
will add it to my list of stuff to merge to the branch.
J
On Friday, August 24, 2012, sv...@va... wrote:
> bart 2012-08-24 18:59:03 +0100 (Fri, 24 Aug 2012)
>
> New Revision: 12897
>
> Log:
> drd: Handle non-zero sem_*wait() return values correctly. Fixes
> #305690.
>
> Modified files:
> trunk/drd/drd_semaphore.c
>
>
> Modified: trunk/drd/drd_semaphore.c (+7 -5)
> ===================================================================
> --- trunk/drd/drd_semaphore.c 2012-08-24 18:57:44 +01:00 (rev 12896)
> +++ trunk/drd/drd_semaphore.c 2012-08-24 18:59:03 +01:00 (rev 12897)
> @@ -339,8 +339,7 @@
>
> /**
> * Called after sem_wait() finished.
> - * @note Do not rely on the value of 'waited' -- some glibc versions do
> - * not set it correctly.
> + * @note Some C libraries do not set the 'waited' value correctly.
> */
> void DRD_(semaphore_post_wait)(const DrdThreadId tid, const Addr
> semaphore, const Bool waited)
> @@ -354,10 +353,10 @@
> DRD_(thread_get_running_tid)(), semaphore,
> p ? p->value : 0, p ? p->value - 1 : 0);
>
> - if (p)
> - {
> + if (p) {
> p->waiters--;
> - p->value--;
> + if (waited)
> + p->value--;
> }
>
> /*
> @@ -378,6 +377,9 @@
> return;
> }
>
> + if (!waited)
> + return;
> +
> if (p->waits_to_skip > 0)
> p->waits_to_skip--;
> else
>
>
> ---------------------------------------------------------------------------
> --- Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|