Changeset 2037
- Timestamp:
- 09/27/08 13:28:04
- Files:
-
- trunk/cherrypy/process/win32.py (modified) (1 diff)
- trunk/cherrypy/process/wspbus.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/process/win32.py
r2012 r2037 99 99 100 100 def wait(self, state, interval=0.1): 101 """Wait for the given state , KeyboardInterrupt or SystemExit.101 """Wait for the given state(s), KeyboardInterrupt or SystemExit. 102 102 103 103 Since this class uses native win32event objects, the interval 104 104 argument is ignored. 105 105 """ 106 # Don't wait for an event that beat us to the punch ;) 107 if self.state != state: 108 event = self._get_state_event(state) 109 win32event.WaitForSingleObject(event, win32event.INFINITE) 106 if isinstance(state, (tuple, list)): 107 # Don't wait for an event that beat us to the punch ;) 108 if self.state not in state: 109 events = tuple([self._get_state_event(s) for s in state]) 110 win32event.WaitForMultipleObjects(events, 0, win32event.INFINITE) 111 else: 112 # Don't wait for an event that beat us to the punch ;) 113 if self.state != state: 114 event = self._get_state_event(state) 115 win32event.WaitForSingleObject(event, win32event.INFINITE) 110 116 111 117 trunk/cherrypy/process/wspbus.py
r2027 r2037 253 253 254 254 def wait(self, state, interval=0.1): 255 """Wait for the given state.""" 255 """Wait for the given state(s).""" 256 if isinstance(state, (tuple, list)): 257 states = state 258 else: 259 states = [state] 260 256 261 def _wait(): 257 while self.state != state:262 while self.state not in states: 258 263 time.sleep(interval) 259 264

