Given the following code:#include <thread>#include <mutex>#include <condition_variable>std::condition_variable g_Condition;std::mutex g_Mutex;int main(){ auto call = []() { std::unique_lock<std::mutex> lock(g_Mutex); std::this_thread::sleep_for(std::chrono::seconds(5)); std::notify_all_at_thread_exit(g_Condition, std::move(lock)); }; std::thread callThread(call); callThread.detach(); std::unique_lock<std::mutex> lock(g_Mutex); g_Condition.wait(lock); return 0;}VS2011 constantly fires assertion "f:\dd\vctools\crt_bld\self_64_amd64\crt\src\thr\mutex.c(140): unlock of unowned mutex"
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results
Please wait...