Created
August 16, 2014 11:16
-
-
Save bazhenovc/7cb217df9792c97edc24 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
BulletManager manager; | |
std::atomic<int> signalQuit; | |
void Thread1() | |
{ | |
while (signalQuit == 0) { | |
manager.Fire(); | |
} | |
} | |
void Thread2() | |
{ | |
while (signalQuit == 0) { | |
manager.Fire(); | |
} | |
} | |
int main() | |
{ | |
std::thread t1(Thread1); | |
std::thread t2(Thread2); | |
signalQuit = 0; | |
bool running = true; | |
while (running) { | |
manager.Update(); | |
if (KeyPressed(ESCAPE)) | |
running = false; | |
} | |
signalQuit = 1; | |
t1.join(); | |
t2.join(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment