From 6d5a8892f34f4034b38da467268de9d489e1024e Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 19 Oct 2014 00:29:34 +0100 Subject: Use std::thread --- src/ByteBuffer.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/ByteBuffer.h') diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h index 70de419f0..e80763772 100644 --- a/src/ByteBuffer.h +++ b/src/ByteBuffer.h @@ -130,10 +130,6 @@ 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 -- cgit v1.2.3 From 664ea804a3fe4a5574d31b27ebe584aafb816be7 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 3 Dec 2014 18:04:08 +0100 Subject: ByteBuffer: Re-added Single-thread access checker. --- src/ByteBuffer.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ByteBuffer.h') diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h index e80763772..2a316fa32 100644 --- a/src/ByteBuffer.h +++ b/src/ByteBuffer.h @@ -133,6 +133,12 @@ protected: 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); -- cgit v1.2.3