LazyUpdate single-threaded version

git-svn-id: svn://ultimatepp.org/upp/trunk@969 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-03-17 13:57:46 +00:00
parent 3325d89c50
commit b27bb5d43b

View file

@ -479,6 +479,17 @@ struct RWMutex::WriteLock : NoCopy {
typedef RWMutex StaticRWMutex;
struct LazyUpdate {
mutable bool dirty;
public:
void Invalidate() { dirty = true; }
bool BeginUpdate() const { return dirty; }
void EndUpdate() const { dirty = false; }
LazyUpdate() { dirty = true; }
};
#define INTERLOCKED
#define INTERLOCKED_(x) { x.Enter(); }