mirror of
https://github.com/Zygo/bees.git
synced 2025-06-16 17:46:16 +02:00
crucible: progress: drop the set() method
set() was broken and redundant. Calling hold() and discarding the returned object has the correct effect. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -22,7 +22,6 @@ namespace crucible {
|
||||
ProgressTracker(const value_type &v);
|
||||
value_type begin();
|
||||
value_type end();
|
||||
void set(const value_type &v);
|
||||
|
||||
ProgressHolder hold(const value_type &v);
|
||||
|
||||
@ -66,16 +65,6 @@ namespace crucible {
|
||||
return m_state->m_end;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void
|
||||
ProgressTracker<T>::set(const value_type &v)
|
||||
{
|
||||
unique_lock<mutex> lock(m_state->m_mutex);
|
||||
if (m_state->m_end < v) {
|
||||
m_state->m_end = v;
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
typename ProgressTracker<T>::value_type
|
||||
ProgressTracker<T>::ProgressHolderState::get() const
|
||||
@ -109,7 +98,7 @@ namespace crucible {
|
||||
unique_lock<mutex> lock(m_state->m_mutex);
|
||||
m_state->m_in_progress[make_pair(m_value, this)] = false;
|
||||
auto p = m_state->m_in_progress.begin();
|
||||
while (p!= m_state->m_in_progress.end()) {
|
||||
while (p != m_state->m_in_progress.end()) {
|
||||
if (p->second) {
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user