PolyThreaded.h 529 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 "PolyString.h"
  12. #include "PolyGlobals.h"
  13. namespace Polycode{
  14. class _PolyExport Threaded {
  15. public:
  16. Threaded(){ threadRunning = true; }
  17. ~Threaded(){}
  18. virtual void killThread() { threadRunning = false; }
  19. virtual void runThread(){while(threadRunning) updateThread(); }
  20. virtual void updateThread() = 0;
  21. bool threadRunning;
  22. };
  23. }