diff options
Diffstat (limited to 'engines/illusions/thread.cpp')
-rw-r--r-- | engines/illusions/thread.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/illusions/thread.cpp b/engines/illusions/thread.cpp index d597d4810b..7ecc3d8606 100644 --- a/engines/illusions/thread.cpp +++ b/engines/illusions/thread.cpp @@ -197,6 +197,14 @@ void ThreadList::terminateThreads(uint32 threadId) { } } +void ThreadList::terminateActiveThreads(uint32 threadId) { + for (Iterator it = _threads.begin(); it != _threads.end(); ++it) { + Thread *thread = *it; + if (thread->_pauseCtr <= 0 && thread->_threadId != threadId) + thread->terminate(); + } +} + void ThreadList::terminateThreadsByTag(uint32 tag, uint32 threadId) { for (Iterator it = _threads.begin(); it != _threads.end(); ++it) { Thread *thread = *it; @@ -213,6 +221,14 @@ void ThreadList::suspendThreadsByTag(uint32 tag, uint32 threadId) { } } +void ThreadList::notifyThreads(uint32 threadId) { + for (Iterator it = _threads.begin(); it != _threads.end(); ++it) { + Thread *thread = *it; + if (thread->_threadId != threadId) + thread->notify(); + } +} + void ThreadList::notifyThreadsByTag(uint32 tag, uint32 threadId) { for (Iterator it = _threads.begin(); it != _threads.end(); ++it) { Thread *thread = *it; @@ -229,6 +245,14 @@ void ThreadList::pauseThreads(uint32 threadId) { } } +void ThreadList::suspendThreads(uint32 threadId) { + for (Iterator it = _threads.begin(); it != _threads.end(); ++it) { + Thread *thread = *it; + if (thread->_threadId != threadId) + thread->suspend(); + } +} + void ThreadList::resumeThreads(uint32 threadId) { for (Iterator it = _threads.begin(); it != _threads.end(); ++it) { Thread *thread = *it; |