[ISSUE #52]Fix infinite loop on tcptransport connect by stcai · Pull Request #59 · apache/rocketmq-client-cpp
The execution order of these two steps below are uncertain:
- Assignment of 'm_ReadDatathread';
- The thread runs 'TcpTransport::runThread';
If the thread runs first, the value of m_ReadDatathread will be NULL, the codes inside 'while (m_ReadDatathread) {}' will never be executed, then 'm_event_base_status' will never store 'true', so TcpTransport::connect will stay on the loop infintely.