summaryrefslogtreecommitdiff
path: root/lib/LuaTask.cc
diff options
context:
space:
mode:
authorpixel <pixel>2008-02-18 09:55:08 +0000
committerpixel <pixel>2008-02-18 09:55:08 +0000
commit2677424e6dd5513b3fae9817214db41cc211a873 (patch)
tree0740a8115e7da6e548ea0eed4e2c48c778598bb5 /lib/LuaTask.cc
parent60ee2d57d95314f00d110c70106115c577dbdafa (diff)
Providing the 'Yield' method for tasks.
Diffstat (limited to 'lib/LuaTask.cc')
-rw-r--r--lib/LuaTask.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/LuaTask.cc b/lib/LuaTask.cc
index 7b1e045..095c3e3 100644
--- a/lib/LuaTask.cc
+++ b/lib/LuaTask.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: LuaTask.cc,v 1.27 2008-01-23 17:53:12 pixel Exp $ */
+/* $Id: LuaTask.cc,v 1.28 2008-02-18 09:55:08 pixel Exp $ */
#include <LuaTask.h>
#include <LuaHandle.h>
@@ -143,6 +143,10 @@ int LuaTask::Do() throw (GeneralException) {
}
#endif
+ if (task == "Yield") {
+ nargs = 0;
+ }
+
if (c)
delete c;
c = 0;
@@ -261,6 +265,8 @@ int LuaTask::Do() throw (GeneralException) {
WaitFor(pid);
Suspend(TASK_ON_HOLD);
#endif
+ } else if (task == "Yield") {
+ Yield();
} else {
L->error("Unknow requested task: " + task);
return TASK_DONE;