From c5f69c22ca51510da1674bf56982f8f1e3ca4a40 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 14 Aug 2014 15:49:05 +0000 Subject: Neither the Bu::Client class or the Bu::ProtocolTelnet class were threadsafe and both really need to be. Bu::Client is used in multi-threaded applications and has been for a while, so it's a no brainer. It may need a little bit more safety added around variable access, but all the buffers are safe now. ProtocolTelnet has it's own issus, and I should probably rework a few parts of it before too long so we can better accomidate things like line editing. --- src/stable/protocoltelnet.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/stable/protocoltelnet.h') diff --git a/src/stable/protocoltelnet.h b/src/stable/protocoltelnet.h index 60faef4..19298dc 100644 --- a/src/stable/protocoltelnet.h +++ b/src/stable/protocoltelnet.h @@ -11,6 +11,7 @@ #include "bu/protocol.h" #include "bu/hash.h" #include "bu/string.h" +#include "bu/mutex.h" // #define __TELNET_DEBUG @@ -210,6 +211,8 @@ namespace Bu #endif private: + Mutex mRead; + Mutex mWrite; Client *pClient; Bu::String sDataBuf; /**< Buffer for regular line data. */ -- cgit v1.2.3