VirtualBox

Changeset 29885 in vbox


Ignore:
Timestamp:
May 31, 2010 9:04:43 AM (15 years ago)
Author:
vboxsync
Message:

VBoxService/PropCache: Added VBoxServicePropCacheFlush().

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp

    r29040 r29885  
    263263    RTStrFree(pszValue);
    264264
     265    return rc;
     266}
     267
     268
     269/**
     270 * Flushes the cache by writing every item regardless of its state.
     271 *
     272 * @param   pCache          The property cache.
     273 */
     274int VBoxServicePropCacheFlush(PVBOXSERVICEVEPROPCACHE pCache)
     275{
     276    AssertPtr(pCache);
     277    int rc = VINF_SUCCESS;
     278    PVBOXSERVICEVEPROPCACHEENTRY pNodeIt = NULL;
     279    if (RT_SUCCESS(RTCritSectEnter(&pCache->CritSect)))
     280    {
     281        RTListForEach(&pCache->ListEntries, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, Node)
     282        {
     283            rc = VBoxServiceWritePropF(pCache->uClientID, pNodeIt->pszName, pNodeIt->pszValue);
     284            if (RT_FAILURE(rc))
     285                break;
     286        }
     287        RTCritSectLeave(&pCache->CritSect);
     288    }
    265289    return rc;
    266290}
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.h

    r29040 r29885  
    3030int VBoxServicePropCacheUpdate(PVBOXSERVICEVEPROPCACHE pCache, const char *pszName, const char *pszValueFormat, ...);
    3131int VBoxServicePropCacheUpdateEx(PVBOXSERVICEVEPROPCACHE pCache, const char *pszName, uint32_t fFlags, const char *pszValueReset, const char *pszValueFormat, ...);
     32int VBoxServicePropCacheFlush(PVBOXSERVICEVEPROPCACHE pCache);
    3233void VBoxServicePropCacheDestroy(PVBOXSERVICEVEPROPCACHE pCache);
    3334#endif
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