Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 826 vs 827 for /trunk/Source Code/Platform/Headers/PlatformDefines.h

Diff revisions: vs.
  @@ -43,7 +43,6 @@
43 43 #include "Core/Headers/NonCopyable.h"
44 44 #include "Core/Headers/GUIDWrapper.h"
45 45 #include "Platform/Threading/Headers/SharedMutex.h"
46 -
47 46 #include "ConditionalWait.h"
48 47
49 48 #ifndef _USE_MATH_DEFINES
  @@ -171,6 +170,25 @@
171 170
172 171 bool PlatformPostInit();
173 172
173 + template <typename T>
174 + struct synchronized {
175 + public:
176 + synchronized& operator=(T const& newval) {
177 + ReadLock lock(mutex);
178 + value = newval;
179 + return *this;
180 + }
181 +
182 + operator T() const {
183 + WriteLock lock(mutex);
184 + return value;
185 + }
186 +
187 + private:
188 + T value;
189 + SharedLock mutex;
190 + };
191 +
174 192 /// Converts an arbitrary positive integer value to a bitwise value used for masks
175 193 template<typename T>
176 194 constexpr T toBit(const T X) {