VirtualBox

Ignore:
Timestamp:
Feb 27, 2012 9:25:12 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76471
Message:

Main/Medium: rework locking scheme to solve lock order violations and long GUI start up time caused by too much locking
Main/all: Remove the enter and leave methods from write locks, they cause hard to find locking problems. Better solve them explicitly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/ProgressImpl.cpp

    r38181 r40257  
    66
    77/*
    8  * Copyright (C) 2006-2010 Oracle Corporation
     8 * Copyright (C) 2006-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    820820        {
    821821            mWaitersCount++;
    822             alock.leave();
     822            alock.release();
    823823            vrc = RTSemEventMultiWait(mCompletedSem,
    824824                                      fForever ? RT_INDEFINITE_WAIT : (RTMSINTERVAL)timeLeft);
    825             alock.enter();
     825            alock.acquire();
    826826            mWaitersCount--;
    827827
     
    884884        {
    885885            mWaitersCount ++;
    886             alock.leave();
     886            alock.release();
    887887            vrc = RTSemEventMultiWait(mCompletedSem,
    888888                                      fForever ? RT_INDEFINITE_WAIT : (unsigned) timeLeft);
    889             alock.enter();
     889            alock.acquire();
    890890            mWaitersCount--;
    891891
     
    16641664        while (!mCompleted && (forever || timeLeft > 0))
    16651665        {
    1666             alock.leave();
     1666            alock.release();
    16671667            rc = mProgresses.back()->WaitForCompletion(forever ? -1 : (LONG) timeLeft);
    1668             alock.enter();
     1668            alock.acquire();
    16691669
    16701670            if (SUCCEEDED(rc))
     
    17481748               (forever || timeLeft > 0))
    17491749        {
    1750             alock.leave();
     1750            alock.release();
    17511751            /* wait for the appropriate progress operation completion */
    17521752            rc = mProgresses[progress]-> WaitForOperationCompletion(operation,
    17531753                                                                    forever ? -1 : (LONG) timeLeft);
    1754             alock.enter();
     1754            alock.acquire();
    17551755
    17561756            if (SUCCEEDED(rc))
Note: See TracChangeset for help on using the changeset viewer.

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