소스 검색

k_scheduler: Mark KScopedSchedulerLock as [[nodiscard]]

Prevents logic bugs like:

KScopedSchedulerLock{kernel};

instead of:

KScopedSchedulerLock lk{kernel};

from slipping through.
Lioncash 5 년 전
부모
커밋
97e2604575
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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();