summaryrefslogtreecommitdiff
path: root/src/systemc/core/process.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/core/process.cc')
-rw-r--r--src/systemc/core/process.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index 830b8c729..1fd16e0d9 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -160,12 +160,16 @@ Process::suspend(bool inc_kids)
if (!_suspended) {
_suspended = true;
- _suspendedReady = false;
- }
-
- if (procKind() != ::sc_core::SC_METHOD_PROC_ &&
- scheduler.current() == this) {
- scheduler.yield();
+ _suspendedReady = scheduler.suspend(this);
+
+ if (procKind() != ::sc_core::SC_METHOD_PROC_ &&
+ scheduler.current() == this) {
+ // This isn't in the spec, but Accellera says that a thread that
+ // self suspends should be marked ready immediately when it's
+ // resumed.
+ _suspendedReady = true;
+ scheduler.yield();
+ }
}
}
@@ -178,7 +182,7 @@ Process::resume(bool inc_kids)
if (_suspended) {
_suspended = false;
if (_suspendedReady)
- ready();
+ scheduler.resume(this);
_suspendedReady = false;
}
}