Changeset 79245 in vbox for trunk/src/VBox/ValidationKit/testdriver/base.py
- Timestamp:
- Jun 19, 2019 3:11:15 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131427
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/base.py
r79180 r79245 409 409 """ 410 410 411 def __init__(self, sCaller): 412 self.sDbgCreated = '%s: %s' % (utils.getTimePrefix(), sCaller); 413 self.fSignalled = False; 414 self.__oRLock = threading.RLock(); 415 self.oCv = threading.Condition(self.__oRLock); 416 self.oOwner = None; 417 self.msStart = timestampMilli(); 418 self.oLocker = None; 411 def __init__(self, sCaller, fnProcessEvents = None): 412 self.sDbgCreated = '%s: %s' % (utils.getTimePrefix(), sCaller); 413 self.fSignalled = False; 414 self.__oRLock = threading.RLock(); 415 self.oCv = threading.Condition(self.__oRLock); 416 self.oOwner = None; 417 self.msStart = timestampMilli(); 418 self.oLocker = None; 419 420 ## Callback function that takes no parameters and will not be called holding the lock. 421 ## It is a hack to work the XPCOM and COM event queues, so we won't hold back events 422 ## that could block task progress (i.e. hangs VM). 423 self.fnProcessEvents = fnProcessEvents; 419 424 420 425 def __del__(self): … … 540 545 Overriable. 541 546 """ 547 if self.fnProcessEvents: 548 self.fnProcessEvents(); 549 542 550 self.lockTask(); 543 551 544 552 fState = self.pollTask(True); 545 553 if not fState: 546 # Don't wait more than 1s. This allow lazy state polling .554 # Don't wait more than 1s. This allow lazy state polling and avoid event processing trouble. 547 555 msStart = timestampMilli(); 548 556 while not fState: … … 558 566 except: 559 567 pass; 568 569 if self.fnProcessEvents: 570 self.unlockTask(); 571 self.fnProcessEvents(); 572 self.lockTask(); 573 560 574 reporter.doPollWork('TdTaskBase.waitForTask'); 561 575 fState = self.pollTask(True); 562 576 563 577 self.unlockTask(); 578 579 if self.fnProcessEvents: 580 self.fnProcessEvents(); 581 564 582 return fState; 565 583
Note:
See TracChangeset
for help on using the changeset viewer.