History

Remove vm_thread reference from exec/fork vm functions.

arr committed 9 years ago

Commit a64d7751 parent 98ad0165 files · +30 −23Browse files

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

Unified · Split

src/vm/scheduler.cpp+2−6
@@ -139,7 +139,7 @@ vm_scheduler_control_t &default_scheduler_t::get_controller() const · 138 unmodified lines
139139 return const_cast<default_scheduler_t&>(*this);
140140 }
141141
142−const vm_thread_t& default_scheduler_t::schedule_thread(std::unique_ptr<vm_thread_t> thread)
142+void default_scheduler_t::schedule_thread(std::unique_ptr<vm_thread_t> thread)
143143 {
144144 assert(thread != nullptr);
145145 if (thread->get_registers().current_thread_state != vm_thread_state_t::ready)
@@ -160,18 +160,14 @@ const vm_thread_t& default_scheduler_t::schedule_thread(std::unique_ptr<vm_threa · 14 unmodified lines
160160 const auto new_thread_id = thread->get_thread_id();
161161 assert(_all_vm_threads.find(new_thread_id) == _all_vm_threads.cend());
162162
163− auto new_thread = std::make_shared<thread_instance_t>(std::move(thread));
164−
165163 // Allocate a new container and set the thread entry
166− _all_vm_threads[new_thread_id] = new_thread;
164+ _all_vm_threads[new_thread_id] = std::make_shared<thread_instance_t>(std::move(thread));
167165
168166 _runnable_vm_thread_ids.push_back(new_thread_id);
169167
170168 // Notify the worker a thread has been enqueued.
171169 lock.unlock();
172170 _worker_event.notify_one();
173−
174− return *(new_thread->vm_thread);
175171 }
176172
177173 void default_scheduler_t::set_tool_dispatch_on_all_threads(vm_tool_dispatch_t *dispatch)