Opened 11 years ago
Closed 11 years ago
#6200 closed Patches (fixed)
patch to have condition_variable and mutex error better handle EINTR
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | Boost 1.49.0 | Component: | thread |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | 1.49 thread mutex eintr phusion passenger | Cc: | viboes |
Description
On some flavors of Linux, for some versions of the pthread library, there are cases where it erroneously sends EINTR. This is a violation of POSIX, but it exists on some customer's production machines.
BOOST_VERIFY aborts on EINTR, but EINTR is usually not fatal, it just means you need to try later. Being that this behavior was found in production, I believe that it would be valuable to have Boost help protect downstream consumers from bad threading library behavior. This allows downstream consumers of Boost to not need to continuously rediscover and re-patch for this same bug.
So, with this in mind, attached is a proposed patch to allow condition_variable and mutex to better handle interacting with this potentially broken threading library behavior.
Attachments (1)
Change History (6)
by , 11 years ago
Attachment: | thread_eintr.patch added |
---|
comment:1 by , 11 years ago
Cc: | added |
---|---|
Keywords: | 1.49 added |
Owner: | changed from | to
Status: | new → assigned |
This part is not correct
55 res=pthread_cond_wait(&cond,&internal_mutex); 55 int ret; 56 do { 57 ret = pthread_cond_wait(&cond,m.mutex()->native_handle()); 58 } while (ret == EINTR);
Note that before the mutex used was internal_mutex. Are you sure that this patch is working for your applications?
comment:2 by , 11 years ago
Milestone: | To Be Determined → Boost 1.49.0 |
---|
Committed in trunk revision [75781] condition variable part.
comment:3 by , 11 years ago
It looks like only the condition_variable and condition_variable_fwd portion of the patch was committed.
The changes to mutex are missing in revision 75781.
Was this done by choice or is it an oversight?
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed in release at [76291]
patch to correct for receiving EINTR in condition_variable and mutex.