# HG changeset patch # User dbuck # Date 1574397131 18000 # Node ID fcd74557a9cc6c316cf14f1f44166687626ed168 # Parent e7df7c86eda14745a674f39c26d8e8b30a75f5a6 8230611: infinite loop in LogOutputList::wait_until_no_readers() Summary: Add copy constructor and copy assignment operator to ensure reader count remains accurate Reviewed-by: kbarrett, dholmes diff -r e7df7c86eda1 -r fcd74557a9cc src/hotspot/share/logging/logOutputList.hpp --- a/src/hotspot/share/logging/logOutputList.hpp Thu Nov 21 18:42:33 2019 -0800 +++ b/src/hotspot/share/logging/logOutputList.hpp Thu Nov 21 23:32:11 2019 -0500 @@ -97,6 +97,20 @@ } 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(); }