Opened 10 years ago
Closed 10 years ago
#7772 closed Bugs (duplicate)
Incorrect condition_variable::notify_one (win32 vc9)
Reported by: | 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)
follow-up: 2 comment:1 by , 10 years ago
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Milestone: | To Be Determined |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Please, could you check if this is a duplicated of #7657?