Opened 14 years ago
Closed 13 years ago
#2067 closed Bugs (fixed)
thread_group::join_all can't be interrupted using thread_group::interrupt_all
Reported by: | Owned by: | Anthony Williams | |
---|---|---|---|
Milestone: | Boost 1.36.0 | Component: | threads |
Version: | Boost 1.35.0 | Severity: | Problem |
Keywords: | Cc: |
Description
In 1.35.0 and the trunk as of r47043, if you're blocked in thread_group::join_all, a subsequent thread_group::interrupt_all is ineffective. It blocks trying to acquire the mutex, and thus never calls interrupt on the underlying threads.
This looks like it could be fixed by switching to a shared_lock.
Attachments (2)
Change History (4)
by , 14 years ago
Attachment: | 2067.patch added |
---|
comment:1 by , 13 years ago
This bug stems from join_all() holding a mutex while giving control to another thread. 2067.1.patch changes this behavior. The 2067.patch does this too but in an unsafe way - the list of threads can change while the list gets iterated. A better fix might combine the two ideas - having shared access for read-only (keeping exclusive access for list modifying routines), _and_ releasing the mutex while calling join().
patch for ticket 2067