PolyThreaded.h 506 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * PolyThreaded.h
  3. * Poly
  4. *
  5. * Created by Ivan Safrin on 3/6/09.
  6. * Copyright 2009 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. // @package Core
  10. #pragma once
  11. #include "PolyGlobals.h"
  12. namespace Polycode{
  13. class _PolyExport Threaded {
  14. public:
  15. Threaded(){ threadRunning = true; }
  16. ~Threaded(){}
  17. virtual void killThread() { threadRunning = false; }
  18. virtual void runThread(){while(threadRunning) updateThread(); }
  19. virtual void updateThread() = 0;
  20. bool threadRunning;
  21. };
  22. }