This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Unexpected EINVAL from pthread_join
- From: Lasse Collin <lasse dot collin at tukaani dot org>
- To: cygwin at cygwin dot com
- Date: Sun, 22 Feb 2015 22:54:37 +0200
- Subject: Unexpected EINVAL from pthread_join
- Authentication-results: sourceware.org; auth=none
It seems that a signal can cause pthread_join to incorrectly return
EINVAL. I debugged it only a little but hopefully someone finds this
useful:
In the file thread.cc, function pthread::join, the call to cygwait may
return WAIT_SIGNALED if a signal is sent to the process. The switch
statement handling the return value assumes that only WAIT_OBJECT_0 and
WAIT_CANCELED are possible. The default section of the switch statement
has a comment "should never happen" and it returns EINVAL. It might be
that the problem occurs only when SA_RESTART isn't used.
--
Lasse Collin | IRC: Larhzu @ IRCnet & Freenode
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple