12345678910111213141516171819202122232425262728293031 |
- #include "TickWorker.h"
- #include "Block.h"
- TickWorker::TickWorker(TickQueue* queue)
- : Thread(),
- queue(queue),
- waiting(0)
- {
- start();
- }
- TickWorker::~TickWorker()
- {
- queue->release();
- }
- void TickWorker::thread()
- {
- Tickable* zTick = queue->zNext(waiting);
- while (zTick)
- {
- zTick->tick(queue);
- zTick = queue->zNext(waiting);
- }
- }
- bool TickWorker::isWaiting() const
- {
- return waiting;
- }
|