Changeset 31604 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 12, 2010 3:17:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/vboxapi.py
r31601 r31604 271 271 def waitForEvents(self, timeout): 272 272 from win32api import GetCurrentThreadId 273 from win32con import INFINITE 273 274 from win32event import MsgWaitForMultipleObjects, \ 274 275 QS_ALLINPUT, WAIT_TIMEOUT, WAIT_OBJECT_0 275 276 from pythoncom import PumpWaitingMessages 276 277 import types 278 279 if not isinstance(timeout, types.IntType): 280 raise TypeError("The timeout argument is not an integer") 277 281 if (self.tid != GetCurrentThreadId()): 278 282 raise Exception("wait for events from the same thread you inited!") 279 283 280 rc = MsgWaitForMultipleObjects(self.handles, 0, timeout, QS_ALLINPUT) 284 if timeout < 0: cMsTimeout = INFINITE 285 else: cMsTimeout = timeout 286 rc = MsgWaitForMultipleObjects(self.handles, 0, cMsTimeout, QS_ALLINPUT) 281 287 if rc >= WAIT_OBJECT_0 and rc < WAIT_OBJECT_0+len(self.handles): 282 288 # is it possible? … … 559 565 Returns 1 if timed out or interrupted in some way. 560 566 Returns 2 on error (like not supported for web services). 561 Returns None or raises an exception if called on the wrong thread or if 562 the timeout is not an integer value. 567 568 Raises an exception if the calling thread is not the main thread (the one 569 that initialized VirtualBoxManager) or if the time isn't an integer. 563 570 """ 564 571 return self.platform.waitForEvents(timeout) … … 566 573 def interruptWaitEvents(self): 567 574 """ 568 569 575 Interrupt a waitForEvents call. 576 This is normally called from a worker thread. 577 578 Returns True on success, False on failure. 570 579 """ 571 580 return self.platform.interruptWaitEvents()
Note:
See TracChangeset
for help on using the changeset viewer.