libstrat: namespace hossynch.hpp

This commit is contained in:
Michael Scire authored and SciresM committed 2019-12-07 12:41:28 -08:00
1 parent 73d904036d
commit bb223eb5ae
57 files changed
+923 -773

No files matched your search

@@ -171,7 +171,7 @@ namespace sts::pm::impl {
class ProcessList final {
private:
HosMutex lock;
os::Mutex lock;
std::vector<std::shared_ptr<ProcessInfo>> processes;
public:
void Lock() {
@@ -140,7 +140,7 @@ namespace sts::pm::impl {
}
/* Process Tracking globals. */
HosThread g_process_track_thread;
os::Thread g_process_track_thread;
auto g_process_waitable_manager = WaitableManager(1);
/* Process lists. */
@@ -155,7 +155,7 @@ namespace sts::pm::impl {
/* Process Launch synchronization globals. */
IEvent *g_process_launch_start_event = CreateWriteOnlySystemEvent();
HosSignal g_process_launch_finish_signal;
os::Event g_process_launch_finish_event;
Result g_process_launch_result = ResultSuccess;
LaunchProcessArgs g_process_launch_args = {};
@@ -286,7 +286,7 @@ namespace sts::pm::impl {
Result LaunchProcessEventCallback(u64 timeout) {
g_process_launch_start_event->Clear();
g_process_launch_result = LaunchProcess(&g_process_launch_args);
g_process_launch_finish_signal.Signal();
g_process_launch_finish_event.Signal();
return ResultSuccess;
}
@@ -402,7 +402,7 @@ namespace sts::pm::impl {
/* Process Management. */
Result LaunchTitle(u64 *out_process_id, const ncm::TitleLocation &loc, u32 flags) {
/* Ensure we only try to launch one title at a time. */
static HosMutex s_lock;
static os::Mutex s_lock;
std::scoped_lock lk(s_lock);
/* Set global arguments, signal, wait. */
@@ -411,9 +411,8 @@ namespace sts::pm::impl {
.location = loc,
.flags = flags,
};
g_process_launch_finish_signal.Reset();
g_process_launch_start_event->Signal();
g_process_launch_finish_signal.Wait();
g_process_launch_finish_event.Wait();
return g_process_launch_result;
}
@@ -45,7 +45,7 @@ namespace sts::pm::resource {
constexpr size_t ExtraSystemMemorySizeAtmosphere = 24 * Megabyte;
/* Globals. */
HosMutex g_resource_limit_lock;
os::Mutex g_resource_limit_lock;
Handle g_resource_limit_handles[ResourceLimitGroup_Count];
spl::MemoryArrangement g_memory_arrangement = spl::MemoryArrangement_Standard;
u64 g_system_memory_boost_size = 0;