有没有办法更改Visual Studio 2008注册的公司名称而无需重新安装?
我在Visual Studio 11开发人员预览版中遇到了一个错误,至少我认为这是一个错误并报告了它,但我很感兴趣是否有人知道解决方法.
当我使用std::thread类创建多个线程时,它会导致应用程序崩溃.有时它抛出异常,有时会导致访问冲突,有时它会起作用.重现错误的代码如下所示:
#include <iostream>
#include <thread>
#include <vector>
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
std::vector<std::thread*> threads;
for(int i = 0; i < 10; i++)
{
threads.push_back(new std::thread([i]
{
/*std::cout << "thread " << i << std::endl;*/
/* whatever else that is thread safe, or even an empty lambda */
}));
}
for(int i = 0; i < 10; i++)
{
threads[i]->join();
delete threads[i];
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
无论是使用静态CRT库还是动态CRT库都无关紧要(所有这些都是多线程的).
Stacktrace(抛出异常,解锁无主互斥锁):
test.exe!_NMSG_WRITE(int rterrnum) Line 217 …Run Code Online (Sandbox Code Playgroud)