This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #14652] Fix deadlock on PI mutex inpthread_cond_wait cleanup handler
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 5 Oct 2012 08:02:13 +0530
- Subject: Re: [PATCH][BZ #14652] Fix deadlock on PI mutex inpthread_cond_wait cleanup handler
- References: <20121003161401.30e81133@spoyarek><506E049A.20905@redhat.com>
On Thu, 04 Oct 2012 15:50:18 -0600, Jeff wrote:
> + andl $(ROBUST_BIT|PI_BIT), %ebx
> + cmpl $PI_BIT, %ebx
> What's the point behind including ROBUST_BIT in the mask here?
It's because we do requeue_pi only when the mutex is non-robust and PI.
> + movl (%eax), %ebx
> + andl $TID_MASK, %ebx
> + cmpl %ebx, %gs:TID
> + je 9f
> So when the TID doesn't match don't lock and just bail out? Is that
> really the right thing to do?
It's the other way around. If the TIDs match, we don't lock and bail
out, because it means that we already had the lock.
Regards,
Siddhesh