SHARE
TWEET

Untitled

a guest Apr 18th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static GlobalData g;
  2.  
  3. void thread1()
  4. {
  5.     while(true) {
  6.         if (g.ptr)
  7.             g.ptr->method();
  8.     }
  9. }
  10.  
  11. void thread2()
  12. {
  13.    g.ptr = new Game();
  14.    g.ptr->run();
  15.    delete g.ptr;
  16. }
  17.  
  18. void main()
  19. {
  20.    start_thread1();
  21.    start_thread2();
  22.  
  23.    do_something_else();
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top