diff options
author | Mattes D <github@xoft.cz> | 2014-12-07 18:15:23 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-12-07 18:15:23 +0100 |
commit | 8ad1afcc1b98c03bd77b0d85236643ba04795d38 (patch) | |
tree | e340889a2d505f10fd45a80f7b951f3165d6294a /src/ByteBuffer.h | |
parent | cEvent: Changed chrono duration resolution. (diff) | |
parent | Fixed format warning. (diff) | |
download | cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.gz cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.bz2 cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.lz cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.xz cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.zst cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.zip |
Diffstat (limited to 'src/ByteBuffer.h')
-rw-r--r-- | src/ByteBuffer.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h index 70de419f0..2a316fa32 100644 --- a/src/ByteBuffer.h +++ b/src/ByteBuffer.h @@ -130,13 +130,15 @@ protected: char * m_Buffer; size_t m_BufferSize; // Total size of the ringbuffer - #ifdef _DEBUG - volatile unsigned long m_ThreadID; // Thread that is currently accessing the object, checked via cSingleThreadAccessChecker - #endif // _DEBUG - size_t m_DataStart; // Where the data starts in the ringbuffer size_t m_WritePos; // Where the data ends in the ringbuffer size_t m_ReadPos; // Where the next read will start in the ringbuffer + + #ifdef _DEBUG + /** The ID of the thread currently accessing the object. + Used for checking that only one thread accesses the object at a time, via cSingleThreadAccessChecker. */ + mutable std::thread::id m_ThreadID; + #endif /** Advances the m_ReadPos by a_Count bytes */ void AdvanceReadPos(size_t a_Count); |