Advertisement
C0BRA

Untitled

Aug 5th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. void WindowContainer::Show(const Vector& Position)
  2. {
  3.     if(_Running)
  4.         return;
  5.     _Running = true;
  6.    
  7.     WindowSystem::RegisterWindow(*this, Position);
  8.    
  9.     _RunningMutex.lock();
  10.     _RunningMutex.lock(); // Lock the thread, eventually the input thread in the
  11.                           // WindowSystem will call `this->Close()` where the
  12.                           // mutex will be unlocked, and allowed to continue.
  13.    
  14.     _RunningMutex.unlock(); // for consistancy sake, remove the first lock.
  15.    
  16.     //while(_Running)
  17.     //  Util::Sleep(1.0 / 10.0); // check 10 times per second  
  18. }
  19.  
  20. void WindowContainer::Close()
  21. {
  22.     if(!_Running)
  23.         return;
  24.    
  25.     WindowSystem::UnregisterWindow(*this);
  26.     _Running = false;
  27.     _RunningMutex.unlock();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement