Changeset 31607 in vbox for trunk/src/VBox
- Timestamp:
- Aug 12, 2010 3:42:35 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/vboxapi.py
r31604 r31607 206 206 from win32con import DUPLICATE_SAME_ACCESS 207 207 from win32api import GetCurrentThread,GetCurrentThreadId,DuplicateHandle,GetCurrentProcess 208 import threading 208 209 pid = GetCurrentProcess() 209 210 self.tid = GetCurrentThreadId() … … 217 218 win32com.client.gencache.EnsureDispatch('VirtualBox.Session') 218 219 win32com.client.gencache.EnsureDispatch('VirtualBox.VirtualBox') 220 self.oIntCv = threading.Condition() 221 self.fInterrupted = False; 219 222 220 223 def getSessionObject(self, vbox): … … 271 274 def waitForEvents(self, timeout): 272 275 from win32api import GetCurrentThreadId 273 from win32 conimport INFINITE276 from win32event import INFINITE 274 277 from win32event import MsgWaitForMultipleObjects, \ 275 278 QS_ALLINPUT, WAIT_TIMEOUT, WAIT_OBJECT_0 … … 295 298 # Timeout 296 299 rc = 1; 300 301 # check for interruption 302 self.oIntCv.acquire() 303 if self.fInterrupted: 304 self.fInterrupted = False 305 rc = 1; 306 self.oIntCv.release() 307 297 308 return rc; 298 309 … … 309 320 from win32api import PostThreadMessage 310 321 from win32con import WM_USER 311 return PostThreadMessage(self.tid, WM_USER, None, 0xf241b819) 322 self.oIntCv.acquire() 323 self.fInterrupted = True 324 self.oIntCv.release() 325 try: 326 PostThreadMessage(self.tid, WM_USER, None, 0xf241b819) 327 except: 328 return False; 329 return True; 312 330 313 331 def deinit(self):
Note:
See TracChangeset
for help on using the changeset viewer.