XThread acquire mutants on restore

This commit is contained in:
Dr. Chat
2015-12-27 17:16:35 -06:00
committed by Ben Vanik
parent 5c94062110
commit bca5fb5382
3 changed files with 31 additions and 10 deletions

View File

@@ -18,6 +18,7 @@
#include "xenia/cpu/thread_state.h"
#include "xenia/kernel/util/native_list.h"
#include "xenia/kernel/xobject.h"
#include "xenia/kernel/xmutant.h"
#include "xenia/xbox.h"
namespace xe {
@@ -190,6 +191,11 @@ class XThread : public XObject {
static object_ref<XThread> Restore(KernelState* kernel_state,
ByteStream* stream);
// Internal - do not use.
void AcquireMutantOnStartup(object_ref<XMutant> mutant) {
pending_mutant_acquires_.push_back(mutant);
}
// Steps the thread to a point where it's safe to terminate or read its
// context. Returns the PC after we've finished stepping.
// Pass true for ignore_host if you've stopped the thread yourself
@@ -210,6 +216,8 @@ class XThread : public XObject {
CreationParams creation_params_ = {0};
std::vector<object_ref<XMutant>> pending_mutant_acquires_;
uint32_t thread_id_ = 0;
std::unique_ptr<xe::threading::Thread> thread_;
uint32_t scratch_address_ = 0;