Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pthread_cond_wait() blocks?

3 views
Skip to first unread message

Roy Smith

unread,
Dec 13, 2009, 4:54:48 PM12/13/09
to
I've got an application which looks like it's got a race condition at
shutdown which sometimes causes a thread to hang. Ptrace shows the
top of the hung thread's stack always looks like:

#0 0x0000003407c0c888 in __lll_mutex_lock_wait () from /lib64/
libpthread.so.0
#1 0x0000003407c0a848 in pthread_cond_signal@@GLIBC_2.3.2 ()

I see this mostly on RedHat AS5.2, but I've seen it once on RedHat AS4
as well. We're not seeing it on our Solaris and Windows builds of the
same code. What's going on? I was under the impression that
pthread_cond_signal would never block.

Roy Smith

unread,
Dec 13, 2009, 10:36:44 PM12/13/09
to
On Dec 13, 4:54 pm, Roy Smith <r...@panix.com> wrote:
> I've got an application which looks like it's got a race condition at
> shutdown which sometimes causes a thread to hang...

Oh, never mind, I figured it out. Of all things, there was a race
condition with another thread calling cond_destroy() on the condition
variable before the cond_signal() was done using it. Sigh. No, I
didn't write this mess.

0 new messages