CPU preemption control: remove yield before thread stop
This commit is contained in:
@@ -782,10 +782,13 @@ bool cpu_thread::check_state() noexcept
|
|||||||
if (state0 & cpu_flag::preempt)
|
if (state0 & cpu_flag::preempt)
|
||||||
{
|
{
|
||||||
if (cpu_flag::wait - state0)
|
if (cpu_flag::wait - state0)
|
||||||
|
{
|
||||||
|
if (!escape || !retval)
|
||||||
{
|
{
|
||||||
// Yield itself
|
// Yield itself
|
||||||
escape = false;
|
|
||||||
state0 += cpu_flag::yield;
|
state0 += cpu_flag::yield;
|
||||||
|
escape = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const u128 bits = s_cpu_bits)
|
if (const u128 bits = s_cpu_bits)
|
||||||
|
|||||||
Reference in New Issue
Block a user