mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-15 23:54:24 -04:00
kern: add abstract scoped lock template
This commit is contained in:
parent
57222e8301
commit
2355047715
5 changed files with 53 additions and 57 deletions
|
@ -63,10 +63,8 @@ namespace ams::kern {
|
|||
static void EnableSchedulingAndSchedule(u64 cores_needing_scheduling);
|
||||
};
|
||||
|
||||
class KScopedSchedulerLock {
|
||||
public:
|
||||
ALWAYS_INLINE KScopedSchedulerLock() { KScheduler::s_scheduler_lock.Lock(); }
|
||||
ALWAYS_INLINE ~KScopedSchedulerLock() { KScheduler::s_scheduler_lock.Unlock(); }
|
||||
class KScopedSchedulerLock : KScopedLock<KScheduler::LockType> {
|
||||
explicit ALWAYS_INLINE KScopedSchedulerLock() : KScopedLock(KScheduler::s_scheduler_lock) { /* ... */ }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue