浏览代码

Kernel: Simplify BlockTimeout constructor

Jelle Raaijmakers 4 年之前
父节点
当前提交
c3cff7d70a
共有 1 个文件被更改,包括 8 次插入8 次删除
  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_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)