VirtualBox

Ignore:
Timestamp:
Jun 19, 2019 3:11:15 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131427
Message:

testdriver: Hack to work around what seems like missing processing during syncUploadFile in tdAddGuestCtrl.py/prepareGuestForTesting. bugref:9151 bugref:9320 bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/base.py

    r79180 r79245  
    409409    """
    410410
    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;
    419424
    420425    def __del__(self):
     
    540545        Overriable.
    541546        """
     547        if self.fnProcessEvents:
     548            self.fnProcessEvents();
     549
    542550        self.lockTask();
    543551
    544552        fState = self.pollTask(True);
    545553        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.
    547555            msStart = timestampMilli();
    548556            while not fState:
     
    558566                except:
    559567                    pass;
     568
     569                if self.fnProcessEvents:
     570                    self.unlockTask();
     571                    self.fnProcessEvents();
     572                    self.lockTask();
     573
    560574                reporter.doPollWork('TdTaskBase.waitForTask');
    561575                fState = self.pollTask(True);
    562576
    563577        self.unlockTask();
     578
     579        if self.fnProcessEvents:
     580            self.fnProcessEvents();
     581
    564582        return fState;
    565583
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette