Skip to content

Instantly share code, notes, and snippets.

@edumunoz
Last active March 23, 2016 18:53
Show Gist options
  • Save edumunoz/80275bd231abb56165eb to your computer and use it in GitHub Desktop.
Save edumunoz/80275bd231abb56165eb to your computer and use it in GitHub Desktop.
Repro for a race condition in VSCode
#include <iostream>
#include <thread>
using namespace std;
void test() {
cout << "test" << endl;
}
int main() {
thread threads[100];
for (int i = 0; i < 100; i++) {
threads[i] = thread(test);
}
for (int i = 0; i < 100; i++) {
threads[i].join();
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment