Browse Source

k_scheduler: Mark KScopedSchedulerLock as [[nodiscard]]

Prevents logic bugs like:

KScopedSchedulerLock{kernel};

instead of:

KScopedSchedulerLock lk{kernel};

from slipping through.
nce_cpp
Lioncash 5 years ago
parent
commit
cd6ea98890
  1. 2
      src/core/hle/kernel/k_scheduler.h

2
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();

Loading…
Cancel
Save