summaryrefslogtreecommitdiffstats
path: root/Source/cmConnection.cxx
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2017-07-22 15:29:18 (GMT)
committerBrad King <brad.king@kitware.com>2017-08-31 19:35:46 (GMT)
commit0e4d503384a254c843a065c26f77bc19dfccff16 (patch)
treed37dcc0050435080a9704030d9e6938d7ea708bf /Source/cmConnection.cxx
parent124424e9974ade26521bf4751f3701c1e7d91c3d (diff)
downloadCMake-0e4d503384a254c843a065c26f77bc19dfccff16.zip
CMake-0e4d503384a254c843a065c26f77bc19dfccff16.tar.gz
CMake-0e4d503384a254c843a065c26f77bc19dfccff16.tar.bz2
server: Added thread check to protect writedata
Diffstat (limited to 'Source/cmConnection.cxx')
-rw-r--r--Source/cmConnection.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmConnection.cxx b/Source/cmConnection.cxx
index c0d1b82..f482412 100644
--- a/Source/cmConnection.cxx
+++ b/Source/cmConnection.cxx
@@ -69,6 +69,12 @@ bool cmEventBasedConnection::IsOpen() const
void cmEventBasedConnection::WriteData(const std::string& _data)
{
+#ifndef NDEBUG
+ auto curr_thread_id = uv_thread_self();
+ assert(this->Server);
+ assert(uv_thread_equal(&curr_thread_id, &this->Server->ServeThreadId));
+#endif
+
auto data = _data;
assert(this->WriteStream);
if (BufferStrategy) {