Merge pull request #735 from jwnimmer-tri/dist_sink_reset

add remove_all_sinks method to dist_sink
This commit is contained in:
Gabi Melman 2018-06-21 17:22:18 +03:00 committed by GitHub
commit c639483db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,6 +62,12 @@ public:
std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
_sinks.erase(std::remove(_sinks.begin(), _sinks.end(), sink), _sinks.end());
}
void remove_all_sinks()
{
std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
_sinks.clear();
}
};
using dist_sink_mt = dist_sink<std::mutex>;