return;
if (suspended())
_suspendedReady = true;
- else
+ else if (!scheduled())
scheduler.ready(this);
}
timeoutEvent([this]() { this->timeout(); }),
func(func), _internal(internal), _timedOut(false), _dontInitialize(false),
_needsStart(true), _isUnwinding(false), _terminated(false),
- _suspended(false), _disabled(false), _syncReset(false), syncResetCount(0),
- asyncResetCount(0), _waitCount(0), refCount(0),
- stackSize(::Fiber::DefaultStackSize), dynamicSensitivity(nullptr)
+ _scheduled(false), _suspended(false), _disabled(false),
+ _syncReset(false), syncResetCount(0), asyncResetCount(0), _waitCount(0),
+ refCount(0), stackSize(::Fiber::DefaultStackSize),
+ dynamicSensitivity(nullptr)
{
_dynamic =
(::sc_core::sc_get_status() >
void isUnwinding(bool v) { _isUnwinding = v; }
bool terminated() const { return _terminated; }
+ bool scheduled() const { return _scheduled; }
+ void scheduled(bool new_val) { _scheduled = new_val; }
+
void forEachKid(const std::function<void(Process *)> &work);
bool suspended() const { return _suspended; }
bool _dynamic;
bool _isUnwinding;
bool _terminated;
+ bool _scheduled;
void terminate();
Fiber::primaryFiber()->run();
} else {
_current->popListNode();
+ _current->scheduled(false);
// Switch to whatever Fiber is supposed to run this process. All
// Fibers which aren't running should be parked at this line.
_current->fiber()->run();
if (_stopNow)
return;
+ p->scheduled(true);
+
if (p->procKind() == ::sc_core::SC_METHOD_PROC_)
readyListMethods.pushLast(p);
else