Procházet zdrojové kódy

k_scheduler: Mark KScopedSchedulerLock as [[nodiscard]]

Prevents logic bugs like:

KScopedSchedulerLock{kernel};

instead of:

KScopedSchedulerLock lk{kernel};

from slipping through.
Lioncash před 5 roky
rodič
revize
97e2604575
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/core/hle/kernel/k_scheduler.h

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

@@ -198,7 +198,7 @@ private:
     Common::SpinLock guard{};
 };
 
-class KScopedSchedulerLock : KScopedLock<GlobalSchedulerContext::LockType> {
+class [[nodiscard]] KScopedSchedulerLock : KScopedLock<GlobalSchedulerContext::LockType> {
 public:
     explicit KScopedSchedulerLock(KernelCore& kernel);
     ~KScopedSchedulerLock();