|
Krita Source Code Documentation
|
#include <kis_lock_free_cache.h>
Public Types | |
| typedef int | SeqValue |
Public Member Functions | |
| bool | endRead (int seq) const |
| void | endWrite (int seq) |
| void | invalidate () |
| bool | startRead (int *seq) const |
| bool | startWrite (int *seq) |
Private Member Functions | |
| int | incrementSeqNo (int value) |
Private Attributes | |
| QAtomicInt | m_value |
Static Private Attributes | |
| static const int | IsValidMask = 0x0100 |
| static const int | SeqNoIncrement = 0x0200 |
| static const int | SeqNoMask = ~(WritersCountMask | IsValidMask) |
| static const int | WritersCountIncrement = 0x0001 |
| static const int | WritersCountMask = 0x00FF |
This class implements a state variable for a lockfree cache object. The implementation is actually a variation of a 'seqlock', but with a simple modification: the values of "cache validity", "number of writers" and "sequence number" are multiplexed in a single int value.
Definition at line 19 of file kis_lock_free_cache.h.
| typedef int KisCacheStateValue::SeqValue |
Definition at line 27 of file kis_lock_free_cache.h.
|
inline |
Definition at line 45 of file kis_lock_free_cache.h.
References m_value.
|
inline |
Definition at line 68 of file kis_lock_free_cache.h.
References incrementSeqNo(), IsValidMask, m_value, and WritersCountIncrement.
|
inlineprivate |
Definition at line 83 of file kis_lock_free_cache.h.
References SeqNoIncrement, SeqNoMask, and value().
|
inline |
Definition at line 29 of file kis_lock_free_cache.h.
References incrementSeqNo(), and m_value.
|
inline |
Definition at line 38 of file kis_lock_free_cache.h.
References IsValidMask, m_value, and WritersCountMask.
|
inline |
Definition at line 51 of file kis_lock_free_cache.h.
References incrementSeqNo(), IsValidMask, m_value, WritersCountIncrement, and WritersCountMask.
|
staticprivate |
Definition at line 23 of file kis_lock_free_cache.h.
|
private |
Definition at line 94 of file kis_lock_free_cache.h.
|
staticprivate |
Definition at line 25 of file kis_lock_free_cache.h.
|
staticprivate |
Definition at line 24 of file kis_lock_free_cache.h.
|
staticprivate |
Definition at line 22 of file kis_lock_free_cache.h.
|
staticprivate |
Definition at line 21 of file kis_lock_free_cache.h.