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: eb@… 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)

2067.patch (4.7 KB ) - added by eb@… 14 years ago.
patch for ticket 2067
2067.1.patch (1.3 KB ) - added by mheyman@… 13 years ago.
thread_group releases mutex while calling join()

Download all attachments as: .zip

Change History (4)

by eb@…, 14 years ago

Attachment: 2067.patch added

patch for ticket 2067

by mheyman@…, 13 years ago

Attachment: 2067.1.patch added

thread_group releases mutex while calling join()

comment:1 by anonymous, 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().

comment:2 by Anthony Williams, 13 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk, commit 57169

Note: See TracTickets for help on using tickets.