Opened 10 years ago

Closed 10 years ago

#7772 closed Bugs (duplicate)

Incorrect condition_variable::notify_one (win32 vc9)

Reported by: jaime.legido@… Owned by: Anthony Williams
Milestone: Component: thread
Version: Boost 1.52.0 Severity: Regression
Keywords: win32 vc9 Cc:

Description

When someone calls condition_variable::notify_one never "generations.erase" removes any element.

In versión 1.52 this code has been changed thread\win32\condition_variable.hpp:196 struct entry_manager { ...

~entry_manager() {

if(! entry->is_notified()) {

entry->remove_waiter();

}

}

...

Never call "entry->remove_waiter()" therefore not remove anything from generations vector.

Code example

#define BOOST_THREAD_USE_DLL #include <boost/thread.hpp>

boost::condition_variable cv; boost::mutex mt; void fTest() {

boost::mutex::scoped_lock sl(mt); while(1) {

cv.wait(sl);

}

}

int _tmain(int argc, _TCHAR* argv[]) {

boost::thread th = boost::thread(boost::bind(&fTest));

while(1) {

cv.notify_one(); boost::this_thread::sleep(boost::posix_time::seconds(1));

}

return 0;

}

Change History (3)

comment:1 by viboes, 10 years ago

Please, could you check if this is a duplicated of #7657?

in reply to:  1 comment:2 by anonymous, 10 years ago

Replying to viboes:

Please, could you check if this is a duplicated of #7657?

Yes, It's the same problem. It occurs in MSVS08 too. I shouldn't have sent this ticket, but I didn't see #7657 I'm sorry

comment:3 by viboes, 10 years ago

Milestone: To Be Determined
Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.