Last active
March 23, 2016 18:53
-
-
Save edumunoz/80275bd231abb56165eb to your computer and use it in GitHub Desktop.
Repro for a race condition in VSCode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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