Explorar o código

kernel/scheduler: Mark SchedulerLock constructor as nodiscard

Allows the compiler to warn about cases where the constructor is used
but then immediately discarded, which is a potential cause of
locking/unlocking bugs.
Lioncash %!s(int64=6) %!d(string=hai) anos
pai
achega
f808258ed9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/core/hle/kernel/scheduler.h

+ 1 - 1
src/core/hle/kernel/scheduler.h

@@ -289,7 +289,7 @@ private:
 
 class SchedulerLock {
 public:
-    explicit SchedulerLock(KernelCore& kernel);
+    [[nodiscard]] explicit SchedulerLock(KernelCore& kernel);
     ~SchedulerLock();
 
 protected: