VirtualBox

Ignore:
Timestamp:
Feb 12, 2015 12:59:44 PM (10 years ago)
Author:
vboxsync
Message:

XPCOM/ipcDConnectService.cpp: make sure that sufficient workers are created when several messages arrive before any of them gets picked up by the possibly waiting (or newly created) workers. Not the ideal solution (could create too many workers), but hard to do better with this bad code. Fixes public bug ticket #13802. Contributed by Alexander Urakov. Thanks!

Location:
trunk/src/libs/xpcom18a4/ipc/ipcd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp

    r52413 r54176  
    35543554  mon.Enter();
    35553555  // examine the queue
    3556   if (!mPendingQ.IsEmpty() && !mWaitingWorkers)
     3556  if (mPendingQ.Count() > mWaitingWorkers)
    35573557  {
    35583558    // wait a little while to let the workers empty the queue.
     
    35653565    mon.Enter();
    35663566    // examine the queue again
    3567     if (!mPendingQ.IsEmpty() && !mWaitingWorkers)
     3567    if (mPendingQ.Count() > mWaitingWorkers)
    35683568    {
    35693569      // we need one more worker
  • trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcList.h

    r1 r54176  
    175175    }
    176176
     177    // gets count of list elements
     178    PRUint32 Count()
     179    {
     180        T *obj = mHead;
     181        PRUint32 count = 0;
     182        while (obj) {
     183            count++;
     184            obj = obj->mNext;
     185        }
     186
     187        return count;
     188    }
     189
    177190protected:
    178191    void AdvanceHead()
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