top | item 9807576

(no title)

ddustin | 10 years ago

The problem is

    vector<condition_variable_any*> waiters;
Can realloc at any moment, making the following code unsafe:

    vector<condition_variable_any*>::iterator it;
    for (it = m_array[index].waiters.begin();
         it != m_array[index].waiters.end();
         ++it) {
      (*it)->notify_one();
    }
If a realloc occurs between the calls to begin() and end() than the loop can become infinite.

discuss

order

No comments yet.