[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] [PATCH 2/6] libgst: Do not make a suspended process run
From: |
Holger Hans Peter Freyther |
Subject: |
[Help-smalltalk] [PATCH 2/6] libgst: Do not make a suspended process runnable again. |
Date: |
Thu, 9 Jan 2014 19:09:00 +0100 |
This could be triggered with with the JIT and a simple test case
like this:
p := [3 factorial] newProcess.
p singleStep. p suspend.
self assert: p isSuspended
2014-01-09 Holger Hans Peter Freyther <address@hidden>
* interp.c: Check if the process is already suspended.
---
libgst/ChangeLog | 4 ++++
libgst/interp.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/libgst/ChangeLog b/libgst/ChangeLog
index 6e48372..954b58f 100644
--- a/libgst/ChangeLog
+++ b/libgst/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-09 Holger Hans Peter Freyther <address@hidden>
+
+ * interp.c: Check if the process is already suspended.
+
2013-12-22 Holger Hans Peter Freyther <address@hidden>
* comp.c: Only flush the cache once when adding a new
diff --git a/libgst/interp.c b/libgst/interp.c
index 0a01361..ab67daf 100644
--- a/libgst/interp.c
+++ b/libgst/interp.c
@@ -1794,7 +1794,8 @@ resume_process (OOP processOOP,
{
/* We're resuming a process with a *equal or higher* priority, so sleep
the current one and activate the new one */
- sleep_process (activeOOP);
+ if (active->myList != _gst_nil_oop)
+ sleep_process (activeOOP);
activate_process (processOOP);
}
else
--
1.8.5.2