VirtualBox

Changeset 8756 in vbox for trunk/src


Ignore:
Timestamp:
May 11, 2008 2:43:49 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30736
Message:

Main/AutoLock: Fixed: Two or more write locks could be acquired simultaneously on different threads if a read lock was requested while one or more write locks were pending.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/AutoLock.cpp

    r8726 r8756  
    373373
    374374            /* write locks are top priority, so let them go if they are
    375              * pending */
    376             if (mWriteLockPending != 0)
     375             * pending and we're the only reader so far */
     376            if (mWriteLockPending != 0 && isFirstReadLock)
    377377            {
    378378                isWriteLock = true;
    379                 /* the first postponed reader kicks pending writers */
    380                 if (isFirstReadLock)
    381                     RTSemEventSignal (mGoWriteSem);
     379                /* note that we must not signal mGoWriteSem here because it
     380                 * has been already signaled by unlockWrite() or by
     381                 * unlockRead() */
    382382            }
    383383        }
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