rfc2217/close(): fix race-condition: when stopping the read loop, do not set self._thread = None inside the thread itself as there may be a race-condition with the method close().
The method close() closes the socket, which stops the read loop. When the read loop stops, it set self._thread to None,
but if it set to None while close() is right between between the execution of "if self._thread:" and "self._thread.join()",
close() will raise an AttributeError.

Signed-off-by: Jerome Flesch <ext-jerome.flesch@flowbird.group>
1 file changed