History

Add support for traps in VM Add instruction trap to enable single step scenario in debugger Remote get_state() function from thread

arr committed 9 years ago

Commit cb408a11 parent eb570d98 files · +120 −40Browse files

Showing the changes to src/vm/scheduler.cpp (1 of 8 files). Show all

Unified · Split

src/vm/scheduler.cpp+3−3
@@ -130,7 +130,7 @@ vm_scheduler_control_t &default_scheduler_t::get_controller() const · 129 unmodified lines
130130 const vm_thread_t& default_scheduler_t::schedule_thread(std::unique_ptr<runtime::vm_thread_t> thread)
131131 {
132132 assert(thread != nullptr);
133− if (thread->get_state() != vm_thread_state_t::ready)
133+ if (thread->get_registers().current_thread_state != vm_thread_state_t::ready)
134134 throw vm_system_exception{ "Scheduled thread in invalid state" };
135135
136136 if (debug::is_component_tracing_enabled<debug::component_trace_t::scheduler>())
@@ -284,7 +284,7 @@ std::shared_ptr<default_scheduler_t::thread_instance_t> default_scheduler_t::nex · 147 unmodified lines
284284 // Check if the passed in thread should be enqueued
285285 if (prev_thread != nullptr)
286286 {
287− const auto current_state = prev_thread->vm_thread->get_state();
287+ const auto current_state = prev_thread->vm_thread->get_registers().current_thread_state;
288288
289289 // This system thread releases ownership of the vm thread after it has been enqueued
290290 std::lock_guard<std::mutex> vm_thread_ownership{ prev_thread->system_thread_ownership, std::adopt_lock };
@@ -367,7 +367,7 @@ void default_scheduler_t::perform_gc(bool is_gc_thread, std::unique_lock<std::mu · 76 unmodified lines
367367 for (auto &p : _all_vm_threads)
368368 {
369369 auto &vm_thread = p.second->vm_thread;
370− if (vm_thread->get_state() != vm_thread_state_t::broken)
370+ if (vm_thread->get_registers().current_thread_state != vm_thread_state_t::broken)
371371 result.push_back(vm_thread);
372372 }
373373