diff options
| author | Stefan Boberg <[email protected]> | 2021-08-05 21:37:35 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-08-05 21:37:35 +0200 |
| commit | 5f96a135c503c02e5ef200be1a4f68be4ada60c2 (patch) | |
| tree | c1ac1cfdeddd297ba80b0284aa1f3bbf3348d053 /zencore/include | |
| parent | Added Oodle to CompressedBuffer (#5) (diff) | |
| download | zen-5f96a135c503c02e5ef200be1a4f68be4ada60c2.tar.xz zen-5f96a135c503c02e5ef200be1a4f68be4ada60c2.zip | |
Added basic NamedMutex implementation
Diffstat (limited to 'zencore/include')
| -rw-r--r-- | zencore/include/zencore/thread.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/zencore/include/zencore/thread.h b/zencore/include/zencore/thread.h index 46b251e07..d27d0f189 100644 --- a/zencore/include/zencore/thread.h +++ b/zencore/include/zencore/thread.h @@ -102,6 +102,21 @@ public: ZENCORE_API explicit NamedEvent(std::u8string_view EventName); }; +/** Basic abstraction of a named (system wide) mutex primitive + */ +class NamedMutex +{ +public: + ~NamedMutex(); + + ZENCORE_API [[nodiscard]] bool Create(std::string_view MutexName); + + ZENCORE_API static bool Exists(std::string_view MutexName); + +private: + void* m_MutexHandle = nullptr; +}; + /** Basic process abstraction */ class Process |