Boost logo

Boost Users :

From: jkharris7_at_[hidden]
Date: 2004-12-27 15:11:59


Boost 1.32.0 on MSVC71

I have a test where I have one writer and five readers, each attempting the
appropriate lock for their function on a read_write_mutex, and none doing it
recursively.

It keeps asserting on me like this:
.....Assertion failed: ++loop_count == 1, file read_write_mutex.cpp, line 173

The above happens (in do_write_lock()) when I select reader_priority. Something
similar happens in do_read_lock() when I select writer_priority.

        while (m_state == -1 || m_num_readers_to_wake == 0)
        {
            BOOST_ASSERT(++loop_count == 1); //Check for invalid loop conditions
(but will also detect spurious wakeups)
            ++m_num_waiting_readers;
            m_waiting_readers.wait(l);
            --m_num_waiting_readers;
        }

In release mode, it's fine, but what could be causing these "spurious wakeups"?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net