VirtualBox

Changeset 31034 in vbox


Ignore:
Timestamp:
Jul 23, 2010 7:22:44 AM (14 years ago)
Author:
vboxsync
Message:

Main, Python: session API changes, cleanup, tweaks

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r31014 r31034  
    491491        vb = ctx['vb']
    492492        session = ctx['mgr'].getSessionObject(vb)
    493         mach.lockForSession(session, True)
     493        mach.lockMachine(session, ctx['global'].constants.LockType_Shared)
    494494    except Exception,e:
    495495        printErr(ctx, "Session to '%s' not open: %s" %(mach.name,str(e)))
  • trunk/src/VBox/Main/EventImpl.cpp

    r31018 r31034  
    812812    ::RTCritSectEnter(&mcsQLock);
    813813
    814     // If there was no events reading from the listener for the long time,
    815     // and events keep coming we shall unregister it.
    816     if ((mQueue.size() > 200) && ((RTTimeMilliTS() - mLastRead) > 60 * 1000))
     814    // If there was no events reading from the listener for the long time,
     815    // and events keep coming, or queue is oversized we shall unregister this listener.
     816    uint64_t sinceRead = RTTimeMilliTS() - mLastRead;
     817    uint32_t queueSize = mQueue.size();
     818    if ( (queueSize > 200) || ((queueSize > 100) && (sinceRead > 60 * 1000)))
    817819    {
    818820        ::RTCritSectLeave(&mcsQLock);
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r31019 r31034  
    315315    const RTTHREAD                      threadAsyncEvent;
    316316    EventQueue * const                  pAsyncEventQ;
    317 
    318 #ifdef RT_OS_WINDOWS
    319     ComEventsHelper                     mComEvHelper;
    320 #endif
    321317    const ComObjPtr<EventSource>        pEventSource;
    322318};
  • trunk/src/VBox/Main/glue/vboxapi.py

    r31014 r31034  
    521521    def openMachineSession(self, mach, permitSharing = True):
    522522         session = self.mgr.getSessionObject(self.vbox)
    523          mach.lockForSession(session, permitSharing)
     523         if permitSharing:
     524             type = self.constants.LockType_Shared
     525         else:
     526             type = self.constants.LockType_Write
     527         mach.lockMachine(session, type)
    524528         return session
    525529
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