Пример #1
0
    void addWindow(std::tr1::shared_ptr<T>& window)
    {
      std::tr1::shared_ptr<CoilWindow> win 
	= std::tr1::static_pointer_cast<CoilWindow>(window);
      if (!isRunning()) M_throw() << "Coil is not running, cannot add a window";

      _coilQueue.queueTask(magnet::function::Task::makeTask(&CoilMaster::addWindowFunc, this, win));

      //Spinlock waiting for the window to initialize
      while ((!window->isReady())) 
	{ 
	  smallSleep(); 
	  if (!isRunning())
	    M_throw() << "Coil failed to add the window as the main render thread died";
	}
    }