Opened 8 years ago
Closed 5 years ago
#10665 closed Bugs (fixed)
boost::uuids::name_generator::operator() is not const, as promised in the documentation
Reported by: | Owned by: | James E. King, III | |
---|---|---|---|
Milestone: | Boost 1.66.0 | Component: | uuid |
Version: | Boost 1.56.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The uuids::name_generator holds an internal state (detail::sha1 sha), which is resetted on every operator() call, hence the operator() cannot be const.
So the generators aren't reentrant and cannot be shared between threads. :-(
Solution:
Make the state a local variable in the operator(). So the operator() can be const (as documentation promises) and the class becomes reentrant.
Change History (3)
comment:1 by , 5 years ago
Owner: | changed from | to
---|
comment:2 by , 5 years ago
comment:3 by , 5 years ago
Milestone: | To Be Determined → Boost 1.66.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
PR to resolve: https://github.com/boostorg/uuid/pull/23