title: threading.Event().wait() is not notified after calling event.set()
body: <p>I came across a very strange issue when using threading.Event() and couldn't understand what is going on? I must have missed something, please can you point it out?</p>
  
  <p>I have a Listener class which shares the same event object with signal handler, here is my simplified code:</p>
  
  <pre><code>import threading, time
  
  class Listener(object):    
  
      def __init__(self, event):        
          super(Listener, self).__init__()
          self.event = event
  
      def start(self):                
          while not self.event.is_set():            
              print("Listener started, waiting for messages ...")    
              self.event.wait()
  
          print("Listener is terminated ...")
          self.event.clear()    
  
  event = threading.Event()
  
  def handler(signum, frame):    
      global event
      event.set()
      print('Signal handler called with signal [%s]' % signum)
  
  if __name__ == "__main__": 
      signal.signal(signal.SIGINT, handler)
      listener = Listener(event)
      listener.start()
  </code></pre>
  
  <p>After I run the code, I press ctrl+c to interrupt it, nothing actually happens. I have to use kill -9 to kill the process if I want to quit. However if I supply an argument to <code>event.wait()</code>, it worked. but it keeps printing out:</p>
  
  <blockquote>
    <p>Listener started, waiting for messages ..."</p>
  </blockquote>
  
  <p>every timedout seconds. But it will print out:</p>
  
  <blockquote>
    <p>Listener is terminated ...</p>
  </blockquote>
  
  <p>upon Ctrl+c which is what I want.</p>
  
  <pre><code>while not self.event.is_set():
          print("Listener started, waiting for messages ...")
          self.event.wait(1)
  </code></pre>
  
  <p>Why do I have to give a timeout argument in <code>event.wait()</code> to make it responding to ctrl+c event please? According to the document <a href="http://docs.python.org/2/library/threading.html#event-objects" rel="nofollow">http://docs.python.org/2/library/threading.html#event-objects</a>, the event.wait() Threads that call <code>wait()</code> once the flag is true will not block at all. I am using python 2.7.3 by the way.</p>