#NEWLINE# def __init__( self , impl = None ) : #NEWLINE# #INDENT# self . _impl = ( impl or _poll ( ) ) #NEWLINE# if hasattr ( self . _impl , 'fileno' ) : #NEWLINE# #INDENT# set_close_exec ( self . _impl . fileno ( ) ) #NEWLINE# #UNINDENT# self . _handlers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _events = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _callbacks = [ ] #NEWLINE# self . _callback_lock = threading . Lock ( ) #NEWLINE# self . _timeouts = [ ] #NEWLINE# self . _running = False #NEWLINE# self . _stopped = False #NEWLINE# self . _thread_ident = None #NEWLINE# self . _blocking_signal_threshold = None #NEWLINE# self . _waker = Waker ( ) #NEWLINE# self . add_handler ( self . _waker . fileno ( ) , ( lambda fd , events : self . _waker . consume ( ) ) , impl . READ )