I have a portion of code, where one thread calls something like:
cond->notify_all();
delete cond;
with
std::condition_variable_any cond;
Afaik, this should work, since I should be allowed to delete the condition variable, as soon as I notified all threads waiting on it, they don't have to have resumed from the wait call.
On Windows, this sometimes, crashes for me with an error:
mutex destroyed while busy
printed to stdout
On linux, with clang 3.5 this works perfectly fine, on windows I use Visual Studio 2013, with v120 tookit, v120 is the default one.
Did I do something wrong, did I missunderstand the standard, or is M$ doing something wrong here? If it does, how can I work around that?