Преглед на файлове

Kernel: Add TimeManagement::is_initialized()

This allows clients to check whether TimeManagement is available before
trying to ask it about time related things.
Andreas Kling преди 3 години
родител
ревизия
0592f80186
променени са 2 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 5 0
      Kernel/Time/TimeManagement.cpp
  2. 1 0
      Kernel/Time/TimeManagement.h

+ 5 - 0
Kernel/Time/TimeManagement.cpp

@@ -27,6 +27,11 @@ namespace Kernel {
 
 static Singleton<TimeManagement> s_the;
 
+bool TimeManagement::is_initialized()
+{
+    return s_the.is_initialized();
+}
+
 TimeManagement& TimeManagement::the()
 {
     return *s_the;

+ 1 - 0
Kernel/Time/TimeManagement.h

@@ -34,6 +34,7 @@ class TimeManagement {
 public:
     TimeManagement();
     static void initialize(u32 cpu);
+    static bool is_initialized();
     static TimeManagement& the();
 
     static bool is_valid_clock_id(clockid_t);