diff options
| author | 2017-08-23 18:17:44 -0600 | |
|---|---|---|
| committer | 2017-08-23 18:17:44 -0600 | |
| commit | 61442d6afba2f7528ddf3bbee64e8c2d86a4f4a8 (patch) | |
| tree | b4b16a86d9959e14c01e43f68400342d7224c5a8 /src/core/hle/lock.h | |
| parent | Merge pull request #2893 from Subv/not_schedule_main_thread (diff) | |
| parent | Kernel/Memory: Acquire the global HLE lock when a memory read/write operation... (diff) | |
| download | yuzu-61442d6afba2f7528ddf3bbee64e8c2d86a4f4a8.tar.gz yuzu-61442d6afba2f7528ddf3bbee64e8c2d86a4f4a8.tar.xz yuzu-61442d6afba2f7528ddf3bbee64e8c2d86a4f4a8.zip | |
Merge pull request #2839 from Subv/global_kernel_lock
Kernel/HLE: Use a mutex to synchronize access to the HLE kernel state between the cpu thread and any other possible threads that might touch the kernel (network thread, etc).
Diffstat (limited to 'src/core/hle/lock.h')
| -rw-r--r-- | src/core/hle/lock.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/hle/lock.h b/src/core/hle/lock.h new file mode 100644 index 000000000..8265621e1 --- /dev/null +++ b/src/core/hle/lock.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <mutex> | ||
| 8 | |||
| 9 | namespace HLE { | ||
| 10 | /* | ||
| 11 | * Synchronizes access to the internal HLE kernel structures, it is acquired when a guest | ||
| 12 | * application thread performs a syscall. It should be acquired by any host threads that read or | ||
| 13 | * modify the HLE kernel state. Note: Any operation that directly or indirectly reads from or writes | ||
| 14 | * to the emulated memory is not protected by this mutex, and should be avoided in any threads other | ||
| 15 | * than the CPU thread. | ||
| 16 | */ | ||
| 17 | extern std::mutex g_hle_lock; | ||
| 18 | } // namespace HLE | ||