mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
LazyUpdate single-threaded version
git-svn-id: svn://ultimatepp.org/upp/trunk@969 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
3325d89c50
commit
b27bb5d43b
1 changed files with 11 additions and 0 deletions
|
|
@ -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(); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue