VirtualBox

vbox的更動 25616 路徑 trunk/src/VBox/Runtime/generic


忽略:
時間撮記:
2010-1-2 上午12:13:19 (15 年 以前)
作者:
vboxsync
訊息:

iprt/semrw-*: Added RTSemRWGetReadCount. Adjusted writer fairness a little bit in semrw-generic.cpp.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/generic/semrw-generic.cpp

    r25614 r25616  
    513513     */
    514514    RTNATIVETHREAD hNativeSelf = pThis->CritSect.NativeThreadOwner;
    515     if (!pThis->cReads && (!pThis->cWrites || pThis->hWriter == hNativeSelf))
     515    if (    !pThis->cReads
     516        &&  (   (   !pThis->cWrites
     517                 && (   !pThis->cWritesWaiting /* play fair if we can wait */
     518                     || !cMillies)
     519                )
     520             || pThis->hWriter == hNativeSelf
     521            )
     522       )
    516523    {
    517524        /*
     
    785792}
    786793RT_EXPORT_SYMBOL(RTSemRWGetWriterReadRecursion);
     794
     795
     796RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW RWSem)
     797{
     798    /*
     799     * Validate input.
     800     */
     801    struct RTSEMRWINTERNAL *pThis = RWSem;
     802    AssertPtrReturn(pThis, 0);
     803    AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC,
     804                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
     805                    0);
     806
     807    /*
     808     * Return the requested data.
     809     */
     810    return pThis->cReads;
     811}
     812RT_EXPORT_SYMBOL(RTSemRWGetReadCount);
     813
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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