stratosphere: Use RAII for locks
This renames the Mutex class member functions so that the mutex types satisfy Lockable. This makes them usable with standard std::scoped_lock and std::unique_lock, which lets us use RAII and avoids the need for a custom RAII wrapper :)
This commit is contained in:
1 parent
18153713d9
commit
5b3e8e1c5d
11 files changed
+52
-91
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
#define LAUNCHFLAGS_NOTIFYWHENEXITED(flags) (flags & 1)
|
||||
#define LAUNCHFLAGS_STARTSUSPENDED(flags) (flags & (kernelAbove500() ? 0x10 : 0x2))
|
||||
@@ -32,17 +33,10 @@ class Registration {
|
||||
u64* out_pid;
|
||||
Result result;
|
||||
};
|
||||
class AutoProcessListLock {
|
||||
private:
|
||||
bool has_lock;
|
||||
public:
|
||||
AutoProcessListLock();
|
||||
~AutoProcessListLock();
|
||||
void Unlock();
|
||||
};
|
||||
|
||||
|
||||
static void InitializeSystemResources();
|
||||
static IWaitable *GetProcessLaunchStartEvent();
|
||||
static std::unique_lock<HosRecursiveMutex> GetProcessListUniqueLock();
|
||||
static void SetProcessListManager(WaitableManager *m);
|
||||
static Result ProcessLaunchStartCallback(void *arg, Handle *handles, size_t num_handles, u64 timeout);
|
||||
|
||||
|
||||
Reference in new issue
Block a user