#12958 closed Bugs (fixed)

sync_bounded_queue::wait_pull_front( lve ) might throw

Reported by: enniobarbaro@… Owned by: viboes
Milestone: Boost 1.65.0 Component: thread
Version: Boost 1.63.0 Severity: Problem
Keywords: sync_queue Cc: enniobarbaro@…


Expected behavior:

A call to to sync_bounded_queue<T>::wait_pull_front can only throw via T's assignment operator. If the queue is closed, this is reported via the return value.

Actual behavior:

sync_bounded_queue<T>::wait_pull_front might spuriously throw a sync_queue_is_closed error.

Line 486 of sync_bounded_queue.hpp (current github master) checks if the queue is empty and closed; however the very next line calls the one-argument overload of wait_until_not_empty, which might throw if the queue became closed and empty in the meantime. wait_pull_front should use the overload of wait_until_not_empty which returns a closed flag.

Change History (3)

comment:1 Changed 20 months ago by viboes

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:3 Changed 18 months ago by viboes

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.