mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 21:35:06 +00:00
Kernel: Simplify BlockTimeout constructor
This commit is contained in:
parent
d6dc81874d
commit
c3cff7d70a
1 changed files with 8 additions and 8 deletions
|
@ -17,15 +17,15 @@ Thread::BlockTimeout::BlockTimeout(bool is_absolute, const Time* time, const Tim
|
|||
: m_clock_id(clock_id)
|
||||
, m_infinite(!time)
|
||||
{
|
||||
if (!m_infinite) {
|
||||
if (*time > Time::zero()) {
|
||||
m_time = *time;
|
||||
m_should_block = true;
|
||||
}
|
||||
m_start_time = start_time ? *start_time : TimeManagement::the().current_time(clock_id).value();
|
||||
if (!is_absolute)
|
||||
m_time = m_time + m_start_time;
|
||||
if (m_infinite)
|
||||
return;
|
||||
if (*time > Time::zero()) {
|
||||
m_time = *time;
|
||||
m_should_block = true;
|
||||
}
|
||||
m_start_time = start_time ? *start_time : TimeManagement::the().current_time(clock_id).value();
|
||||
if (!is_absolute)
|
||||
m_time += m_start_time;
|
||||
}
|
||||
|
||||
bool Thread::Blocker::set_block_condition(Thread::BlockCondition& block_condition, void* data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue