title: How to yank a socket from under another thread in Python?
body: <p>I am writing a simple multithreaded chat server in Python3. Sometimes i want to interrupt another thread that is waiting in <a href="https://docs.python.org/3.5/library/socket.html#socket.socket.recv" rel="nofollow noreferrer">socket.recv()</a> to allow the theread to perform cleanup tasks.</p>
  
  <p>Is calling <a href="https://docs.python.org/3.5/library/socket.html#socket.socket.shutdown" rel="nofollow noreferrer">socket.shutdown(socket.SHUT_RDWR)</a> from another thread safe?</p>