early-access version 2415
This commit is contained in:
@@ -1097,14 +1097,14 @@ void KThread::EndWait(ResultCode wait_result_) {
|
||||
// Lock the scheduler.
|
||||
KScopedSchedulerLock sl(kernel);
|
||||
|
||||
// Dummy threads are just used by host threads for locking, and will never have a wait_queue.
|
||||
if (thread_type == ThreadType::Dummy) {
|
||||
ASSERT_MSG(false, "Dummy threads should never call EndWait!");
|
||||
return;
|
||||
}
|
||||
|
||||
// If we're waiting, notify our queue that we're available.
|
||||
if (GetState() == ThreadState::Waiting) {
|
||||
if (wait_queue == nullptr) {
|
||||
// This should never happen, but avoid a hard crash below to get this logged.
|
||||
ASSERT_MSG(false, "wait_queue is nullptr!");
|
||||
return;
|
||||
}
|
||||
|
||||
wait_queue->EndWait(this, wait_result_);
|
||||
}
|
||||
}
|
||||
|
@@ -302,12 +302,10 @@ struct KernelCore::Impl {
|
||||
// Gets the dummy KThread for the caller, allocating a new one if this is the first time
|
||||
KThread* GetHostDummyThread() {
|
||||
auto make_thread = [this]() {
|
||||
std::lock_guard lk(dummy_thread_lock);
|
||||
auto& thread = dummy_threads.emplace_back(std::make_unique<KThread>(system.Kernel()));
|
||||
KAutoObject::Create(thread.get());
|
||||
ASSERT(KThread::InitializeDummyThread(thread.get()).IsSuccess());
|
||||
KThread* thread = KThread::Create(system.Kernel());
|
||||
ASSERT(KThread::InitializeDummyThread(thread).IsSuccess());
|
||||
thread->SetName(fmt::format("DummyThread:{}", GetHostThreadId()));
|
||||
return thread.get();
|
||||
return thread;
|
||||
};
|
||||
|
||||
thread_local KThread* saved_thread = make_thread();
|
||||
@@ -740,7 +738,6 @@ struct KernelCore::Impl {
|
||||
std::mutex server_sessions_lock;
|
||||
std::mutex registered_objects_lock;
|
||||
std::mutex registered_in_use_objects_lock;
|
||||
std::mutex dummy_thread_lock;
|
||||
|
||||
std::atomic<u32> next_object_id{0};
|
||||
std::atomic<u64> next_kernel_process_id{KProcess::InitialKIPIDMin};
|
||||
@@ -798,9 +795,6 @@ struct KernelCore::Impl {
|
||||
std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES> interrupts{};
|
||||
std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{};
|
||||
|
||||
// Specifically tracked to be automatically destroyed with kernel
|
||||
std::vector<std::unique_ptr<KThread>> dummy_threads;
|
||||
|
||||
bool is_multicore{};
|
||||
std::atomic_bool is_shutting_down{};
|
||||
bool is_phantom_mode_for_singlecore{};
|
||||
|
Reference in New Issue
Block a user