aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-09-15 09:03:26 +0200
committerMartin Ridgers <[email protected]>2021-09-15 09:03:26 +0200
commitbbe9afd7a7e19358b02d6880c4027e27fe5e8b80 (patch)
tree073f9bd519c40f0bcd81fd568d1e9a2ef97bbf24 /zencore/include
parentRemoved unused 'thread' include (diff)
downloadzen-bbe9afd7a7e19358b02d6880c4027e27fe5e8b80.tar.xz
zen-bbe9afd7a7e19358b02d6880c4027e27fe5e8b80.zip
Implemented RwLock on non-Windows platforms using std::shared_mutex
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/thread.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/zencore/include/zencore/thread.h b/zencore/include/zencore/thread.h
index 30d0c0897..b18da6031 100644
--- a/zencore/include/zencore/thread.h
+++ b/zencore/include/zencore/thread.h
@@ -4,6 +4,10 @@
#include "zencore.h"
+#if !ZEN_PLATFORM_WINDOWS
+# include <shared_mutex>
+#endif
+
namespace zen {
/**
@@ -60,7 +64,11 @@ public:
};
private:
+#if ZEN_PLATFORM_WINDOWS
void* m_Srw = nullptr;
+#else
+ std::shared_mutex m_Mutex;
+#endif
};
/** Basic abstraction of a simple event synchronization mechanism (aka 'binary semaphore')