Thread_object::destroy(Kobject ***rl)
{
Kobject::destroy(rl);
- check_kdb(kill());
+ if (!is_invalid(false))
+ check_kdb(kill());
assert_kdb(_magic == magic);
}
Address *o_ip = 0, Address *o_sp = 0, Mword *o_flags = 0,
Mword ops = 0)
{
- if (state(false) == Thread_invalid || !space())
+ if (!space())
return false;
if (current() == this)
}
PRIVATE static
-unsigned
+Context::Drq::Result
Thread_object::handle_remote_ex_regs(Drq *, Context *self, void *p)
{
Remote_syscall *params = reinterpret_cast<Remote_syscall*>(p);
params->result = nonull_static_cast<Thread_object*>(self)->ex_regs(params->thread->utcb().access());
- return params->result.proto() == 0 ? Drq::Need_resched : 0;
+ return params->result.proto() == 0 ? Drq::need_resched() : Drq::done();
}
PRIVATE inline NOEXPORT
if (curr == this)
return commit_result(0);
- if (current_cpu() != cpu())
+ if (current_cpu() != home_cpu())
return commit_result(0);
#ifdef FIXME
if (curr != this && (state() & Thread_ready_mask))
{
- curr->switch_exec_schedule_locked (this, Not_Helping);
+ curr->schedule_if(curr->switch_exec_locked(this, Not_Helping));
reinterpret_cast<Utcb::Time_val*>(utcb->values)->t = 0; // Assume timeslice was used up
return commit_result(0, Utcb::Time_val::Words);
}
// -------------------------------------------------------------------
// Gather statistics information about thread execution
-PRIVATE
-unsigned
+PRIVATE inline NOEXPORT
+Context::Drq::Result
Thread_object::sys_thread_stats_remote(void *data)
{
update_consumed_time();
*(Clock::Time *)data = consumed_time();
- return 0;
+ return Drq::done();
}
PRIVATE static
-unsigned
+Context::Drq::Result FIASCO_FLATTEN
Thread_object::handle_sys_thread_stats_remote(Drq *, Context *self, void *data)
{
return nonull_static_cast<Thread_object*>(self)->sys_thread_stats_remote(data);
{
Clock::Time value;
- if (cpu() != current_cpu())
+ if (home_cpu() != current_cpu())
drq(handle_sys_thread_stats_remote, &value, 0, Drq::Any_ctxt);
else
{