aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/mpal
diff options
context:
space:
mode:
authorPaul Gilbert2012-05-06 12:54:57 +1000
committerPaul Gilbert2012-05-06 12:54:57 +1000
commit4c8ce3bec99db9d0b63dd65f1c7a89cbe41a679b (patch)
tree3e3cae29259ba259f6c8122a46cdf63f32ebdc8e /engines/tony/mpal
parent10deebed553fc5d458a20756d963835aa1a86afe (diff)
downloadscummvm-rg350-4c8ce3bec99db9d0b63dd65f1c7a89cbe41a679b.tar.gz
scummvm-rg350-4c8ce3bec99db9d0b63dd65f1c7a89cbe41a679b.tar.bz2
scummvm-rg350-4c8ce3bec99db9d0b63dd65f1c7a89cbe41a679b.zip
TONY: Implemented Scheduler::waitForSingleObject method
This will be the coroutine version of the threading method. With this, the main menu of the demo is now shown.
Diffstat (limited to 'engines/tony/mpal')
-rw-r--r--engines/tony/mpal/mpal.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index 3757cdddcf..78111753ce 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -996,11 +996,12 @@ void ShutUpActionThread(CORO_PARAM, const void *param) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
- HANDLE hThread = *(const HANDLE *)param;
+ int pid = *(const int *)param;
CORO_BEGIN_CODE(_ctx);
- WaitForSingleObject(hThread, INFINITE);
+ CORO_INVOKE_2(_vm->_scheduler.waitForSingleObject, pid, INFINITE);
+
bExecutingAction = false;
CORO_KILL_SELF();
@@ -1554,7 +1555,7 @@ static HANDLE DoAction(uint32 nAction, uint32 ordItem, uint32 dwParam) {
if ((h = g_scheduler->createProcess(ActionThread, newitem)) == NULL)
return INVALID_HANDLE_VALUE;
- if ((h = g_scheduler->createProcess(0, ShutUpActionThread, &h, sizeof(PROCESS *))) == NULL)
+ if ((h = g_scheduler->createProcess(ShutUpActionThread, &h->pid, sizeof(int))) == NULL)
return INVALID_HANDLE_VALUE;
/*