Changeset 57653 in vbox for trunk/src/VBox/Main/src-server/linux
- Timestamp:
- Sep 8, 2015 10:19:37 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/linux/HostPowerLinux.cpp
r57642 r57653 85 85 HostPowerServiceLinux::~HostPowerServiceLinux() 86 86 { 87 int rc; 88 RTMSINTERVAL cMillies = 5000; 89 87 90 /* Closing the connection should cause the event loop to exit. */ 88 91 LogFunc((": Stopping thread\n")); … … 90 93 dbus_connection_close(mpConnection); 91 94 92 RTThreadWait(mThread, 5000, NULL); 95 rc = RTThreadWait(mThread, cMillies, NULL); 96 if (rc != VINF_SUCCESS) 97 LogRelThisFunc(("RTThreadWait() for %u ms failed with %Rrc\n", cMillies, rc)); 93 98 mThread = NIL_RTTHREAD; 94 99 } … … 99 104 NOREF(hThreadSelf); 100 105 HostPowerServiceLinux *pPowerObj = static_cast<HostPowerServiceLinux *>(pInstance); 106 DBusConnection *pConnection = pPowerObj->mpConnection; 101 107 102 108 Log(("HostPowerServiceLinux: Thread started\n")); 103 while (dbus_connection_read_write(p PowerObj->mpConnection, -1))109 while (dbus_connection_read_write(pConnection, -1)) 104 110 { 105 111 DBusMessage *pMessage = NULL; … … 110 116 dbus_bool_t fSuspend; 111 117 112 pMessage = dbus_connection_pop_message(p PowerObj->mpConnection);118 pMessage = dbus_connection_pop_message(pConnection); 113 119 if (pMessage == NULL) 114 120 break; … … 140 146 } 141 147 /* Close the socket or whatever underlying the connection. */ 142 dbus_connection_close(p PowerObj->mpConnection);148 dbus_connection_close(pConnection); 143 149 /* Free in-process resources used for the now-closed connection. */ 144 dbus_connection_unref(pPowerObj->mpConnection); 145 pPowerObj->mpConnection = NULL; 150 dbus_connection_unref(pConnection); 146 151 Log(("HostPowerServiceLinux: Exiting thread\n")); 147 152 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.