- Timestamp:
- Dec 5, 2018 5:43:04 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestProperties/service.cpp
r75986 r75987 60 60 #include <list> 61 61 62 /** @todo Delete the old !ASYNC_HOST_NOTIFY code and remove this define. */63 #define ASYNC_HOST_NOTIFY64 62 65 63 namespace guestProp { … … 321 319 , mcTimestampAdjustments(0) 322 320 , m_fSetHostVersionProps(false) 323 #ifdef ASYNC_HOST_NOTIFY324 321 , mhThreadNotifyHost(NIL_RTTHREAD) 325 322 , mhReqQNotifyHost(NIL_RTREQQUEUE) 326 #endif327 323 { } 328 324 … … 441 437 static DECLCALLBACK(void) dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs); 442 438 443 #ifdef ASYNC_HOST_NOTIFY444 439 /* Thread for handling host notifications. */ 445 440 RTTHREAD mhThreadNotifyHost; … … 447 442 RTREQQUEUE mhReqQNotifyHost; 448 443 static DECLCALLBACK(int) threadNotifyHost(RTTHREAD self, void *pvUser); 449 #endif450 444 451 445 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(Service); … … 1307 1301 } 1308 1302 1309 #ifdef ASYNC_HOST_NOTIFY 1310 static DECLCALLBACK(void) notifyHostAsyncWorker(PFNHGCMSVCEXT pfnHostCallback, 1311 void *pvHostData, 1312 PGUESTPROPHOSTCALLBACKDATA pHostCallbackData) 1313 { 1314 pfnHostCallback(pvHostData, 0 /*u32Function*/, 1315 (void *)pHostCallbackData, 1316 sizeof(GUESTPROPHOSTCALLBACKDATA)); 1303 static DECLCALLBACK(void) 1304 notifyHostAsyncWorker(PFNHGCMSVCEXT pfnHostCallback, void *pvHostData, PGUESTPROPHOSTCALLBACKDATA pHostCallbackData) 1305 { 1306 pfnHostCallback(pvHostData, 0 /*u32Function*/, (void *)pHostCallbackData, sizeof(GUESTPROPHOSTCALLBACKDATA)); 1317 1307 RTMemFree(pHostCallbackData); 1318 1308 } 1319 #endif1320 1309 1321 1310 /** … … 1330 1319 { 1331 1320 LogFlowFunc(("pszName=%s, pszValue=%s, nsTimestamp=%llu, pszFlags=%s\n", pszName, pszValue, nsTimestamp, pszFlags)); 1332 #ifdef ASYNC_HOST_NOTIFY 1333 int rc = VINF_SUCCESS; 1321 int rc; 1334 1322 1335 1323 /* Allocate buffer for the callback data and strings. */ … … 1375 1363 rc = VERR_NO_MEMORY; 1376 1364 } 1377 #else1378 GUESTPROPHOSTCALLBACKDATA HostCallbackData;1379 HostCallbackData.u32Magic = GUESTPROPHOSTCALLBACKDATA_MAGIC;1380 HostCallbackData.pcszName = pszName;1381 HostCallbackData.pcszValue = pszValue;1382 HostCallbackData.nsTimestamp = nsTimestamp;1383 HostCallbackData.pcszFlags = pszFlags;1384 int rc = mpfnHostCallback(mpvHostData, 0 /*u32Function*/,1385 (void *)(&HostCallbackData),1386 sizeof(HostCallbackData));1387 #endif1388 1365 LogFlowFunc(("returning rc=%Rrc\n", rc)); 1389 1366 return rc; … … 1698 1675 1699 1676 1700 #ifdef ASYNC_HOST_NOTIFY1701 1702 1677 /* static */ 1703 1678 DECLCALLBACK(int) Service::threadNotifyHost(RTTHREAD hThreadSelf, void *pvUser) … … 1732 1707 } 1733 1708 1734 #endif /* ASYNC_HOST_NOTIFY */1735 1709 1736 1710 int Service::initialize() … … 1760 1734 } 1761 1735 1762 #ifdef ASYNC_HOST_NOTIFY1763 1736 /* The host notification thread and queue. */ 1764 1737 int rc = RTReqQueueCreate(&mhReqQNotifyHost); … … 1772 1745 RTTHREADFLAGS_WAITABLE, 1773 1746 "GSTPROPNTFY"); 1774 } 1775 1776 if (RT_FAILURE(rc)) 1777 { 1778 if (mhReqQNotifyHost != NIL_RTREQQUEUE) 1779 { 1780 RTReqQueueDestroy(mhReqQNotifyHost); 1781 mhReqQNotifyHost = NIL_RTREQQUEUE; 1782 } 1783 } 1784 #else /* !ASYNC_HOST_NOTIFY */ 1785 int rc = VINF_SUCCESS; 1786 #endif /* !ASYNC_HOST_NOTIFY */ 1787 1788 /* Finally debug stuff (ignore failures): */ 1789 if (RT_SUCCESS(rc)) 1790 HGCMSvcHlpInfoRegister(mpHelpers, "guestprops", "Display the guest properties", Service::dbgInfo, this); 1791 1747 if (RT_SUCCESS(rc)) 1748 { 1749 /* Finally debug stuff (ignore failures): */ 1750 HGCMSvcHlpInfoRegister(mpHelpers, "guestprops", "Display the guest properties", Service::dbgInfo, this); 1751 return rc; 1752 } 1753 1754 RTReqQueueDestroy(mhReqQNotifyHost); 1755 mhReqQNotifyHost = NIL_RTREQQUEUE; 1756 } 1792 1757 return rc; 1793 1758 } 1794 1759 1795 #ifdef ASYNC_HOST_NOTIFY1796 1760 /** 1797 1761 * @callback_method_impl{FNRTSTRSPACECALLBACK, Destroys Property.} … … 1805 1769 } 1806 1770 1807 #endif1808 1771 1809 1772 int Service::uninit() … … 1812 1775 HGCMSvcHlpInfoDeregister(mpHelpers, "guestprops"); 1813 1776 1814 #ifdef ASYNC_HOST_NOTIFY1815 1777 if (mhReqQNotifyHost != NIL_RTREQQUEUE) 1816 1778 { … … 1829 1791 mhProperties = NULL; 1830 1792 } 1831 #endif1832 1793 return VINF_SUCCESS; 1833 1794 }
Note:
See TracChangeset
for help on using the changeset viewer.