8230611: infinite loop in LogOutputList::wait_until_no_readers()

Add copy constructor and copy assignment operator to ensure reader count remains accurate

Reviewed-by: kbarrett, dholmes
This commit is contained in:
David Buck 2019-11-21 23:32:11 -05:00
parent 5161ab9493
commit 3600213f1d

@ -97,6 +97,20 @@ class LogOutputList {
}
public:
Iterator(const Iterator &itr) : _current(itr._current), _list(itr._list){
itr._list->increase_readers();
}
Iterator& operator=(const Iterator& rhs) {
_current = rhs._current;
if (_list != rhs._list) {
rhs._list->increase_readers();
_list->decrease_readers();
_list = rhs._list;
}
return *this;
}
~Iterator() {
_list->decrease_readers();
}