[greg@surety.com] libc/1320: pthread_cond_timedwait returns EINTR in multithreaded processes when gdb is attached to them
Kevin_Hendricks
khendricks@admin.ivey.uwo.ca
Fri Sep 24 10:52:00 GMT 1999
Hi,
>SUS2 says that pthread_cond_timedwait must never return with EINTR. If it
>is interrupted it must either continue waiting or return zero. I think
>continue waiting is the desired action.
>
>I'm not sure whether this is the right way to fix the bug.
Are you sure you want to do this?
Before we started using pthread_cancel and longjmping out of the cleanup handler
clean-up handler, the JDK (Blackdown) used to use a signal to interrupt threads
waiting in condvar_timed_wait and relied on the EINTR to do the trick.
The problem with this approach was that it could miss signals, but people may
still want to be able to break out of timed_waits (you can implement
condvar_wait with condvar_timed_wait and break out of both with a signal).
What does the pthreads spec say about condvar_timed_wait and returning EINTR?
My 2 cents,
Kevin
More information about the Gdb
mailing list