Browse Source

Kernel: Simplify BlockTimeout constructor

Jelle Raaijmakers 4 years ago
parent
commit
c3cff7d70a
1 changed files with 8 additions and 8 deletions
  1. 8 8
      Kernel/ThreadBlockers.cpp

+ 8 - 8
Kernel/ThreadBlockers.cpp

@@ -17,15 +17,15 @@ Thread::BlockTimeout::BlockTimeout(bool is_absolute, const Time* time, const Tim
     : m_clock_id(clock_id)
     : m_clock_id(clock_id)
     , m_infinite(!time)
     , 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)
 bool Thread::Blocker::set_block_condition(Thread::BlockCondition& block_condition, void* data)