summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-24 09:13:58 +0100
committerMattes D <github@xoft.cz>2014-12-24 09:13:58 +0100
commite09348c05d188979c490a9a22d39a1203cacc797 (patch)
tree01c19aa0188843e626c3155ea948b69b3e5e68b4
parentFixed too many slashes. (diff)
downloadcuberite-e09348c05d188979c490a9a22d39a1203cacc797.tar
cuberite-e09348c05d188979c490a9a22d39a1203cacc797.tar.gz
cuberite-e09348c05d188979c490a9a22d39a1203cacc797.tar.bz2
cuberite-e09348c05d188979c490a9a22d39a1203cacc797.tar.lz
cuberite-e09348c05d188979c490a9a22d39a1203cacc797.tar.xz
cuberite-e09348c05d188979c490a9a22d39a1203cacc797.tar.zst
cuberite-e09348c05d188979c490a9a22d39a1203cacc797.zip
-rw-r--r--src/ByteBuffer.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp
index 080176dcd..b441d61ca 100644
--- a/src/ByteBuffer.cpp
+++ b/src/ByteBuffer.cpp
@@ -13,6 +13,15 @@
+/** When defined, each access to a cByteBuffer object is checked whether it's done in the same thread.
+cByteBuffer assumes that it is not used by multiple threads at once, this macro adds a runtime check for that.
+Unfortunately it is very slow, so it is disabled even for regular DEBUG builds. */
+// #define DEBUG_SINGLE_THREAD_ACCESS
+
+
+
+
+
// Try to determine endianness:
#if ( \
defined(__i386__) || defined(__alpha__) || \
@@ -109,7 +118,7 @@ public:
-#ifdef _DEBUG
+#ifdef DEBUG_SINGLE_THREAD_ACCESS
/** Simple RAII class that is used for checking that no two threads are using an object simultanously.
It requires the monitored object to provide the storage for a thread ID.