TickWorker.cpp 499 B

123456789101112131415161718192021222324252627282930
  1. #include "TickWorker.h"
  2. #include "Block.h"
  3. TickWorker::TickWorker(TickQueue* queue)
  4. : Thread(),
  5. queue(queue),
  6. waiting(0)
  7. {
  8. start();
  9. }
  10. TickWorker::~TickWorker()
  11. {}
  12. void TickWorker::thread()
  13. {
  14. Tickable* zTick = queue->zNext(waiting);
  15. while (zTick)
  16. {
  17. zTick->tick(queue);
  18. zTick = queue->zNext(waiting);
  19. }
  20. std::cout << "exiting tick worker " << GetThreadId(this->getThreadHandle());
  21. }
  22. bool TickWorker::isWaiting() const
  23. {
  24. return waiting;
  25. }