1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:25:08 +00:00

Kernel: Remove old block(State) API

New API should be used always :)
This commit is contained in:
Robin Burchell 2019-07-19 09:57:35 +02:00 committed by Andreas Kling
parent 762333ba95
commit 99c5377653
2 changed files with 6 additions and 5 deletions

View file

@ -111,16 +111,16 @@ void Thread::unblock()
void Thread::block_until(const char* state_string, Function<bool()>&& condition)
{
m_blocker = make<ConditionBlocker>(state_string, condition);
block(Thread::Blocked);
block_helper();
Scheduler::yield();
}
void Thread::block(Thread::State new_state)
void Thread::block_helper()
{
bool did_unlock = process().big_lock().unlock_if_locked();
ASSERT(state() == Thread::Running);
m_was_interrupted_while_blocked = false;
set_state(new_state);
set_state(Thread::Blocked);
Scheduler::yield();
if (did_unlock)
process().big_lock().lock();
@ -129,7 +129,7 @@ void Thread::block(Thread::State new_state)
void Thread::block(Blocker& blocker)
{
m_blocker = &blocker;
block(Thread::Blocked);
block_helper();
}
u64 Thread::sleep(u32 ticks)