| 1 |
#include "RTSchedulable.hh" |
| 2 |
|
| 3 |
#include "RTScheduler.hh" |
| 4 |
|
| 5 |
namespace openmsx { |
| 6 |
|
| 7 |
RTSchedulable::RTSchedulable(RTScheduler& scheduler_) |
| 8 |
: scheduler(scheduler_) |
| 9 |
{ |
| 10 |
} |
| 11 |
|
| 12 |
RTSchedulable::~RTSchedulable() |
| 13 |
{ |
| 14 |
cancelRT(); |
| 15 |
} |
| 16 |
|
| 17 |
void RTSchedulable::scheduleRT(uint64_t delta) |
| 18 |
{ |
| 19 |
cancelRT(); |
| 20 |
scheduler.add(delta, *this); |
| 21 |
} |
| 22 |
|
| 23 |
bool RTSchedulable::cancelRT() |
| 24 |
{ |
| 25 |
return scheduler.remove(*this); |
| 26 |
} |
| 27 |
|
| 28 |
bool RTSchedulable::isPendingRT() const |
| 29 |
{ |
| 30 |
return scheduler.isPending(*this); |
| 31 |
} |
| 32 |
|
| 33 |
} |