Skip to content

Commit eb27f59

Browse files
committed
Merge #131: doc: fix startAsyncThread comment
063ff18 fix startAsyncThread comment (Ryan Ofsky) Pull request description: While implementing #129 I noticed startAsyncThread comment wasn't totally accurate so this should fix that. Top commit has no ACKs. Tree-SHA512: b3ff8c53752c65c3d58af8dddd13bc718d18c230adb0b40c674b381e47629ed0780650e6bb017a3238093c4e12a7b5b02244ad90871b005a9a562330b5ea4ba7
2 parents caf01fa + 063ff18 commit eb27f59

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

include/mp/proxy-io.h

+11-5
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,17 @@ class EventLoop
155155
return post(std::ref(callable));
156156
}
157157

158-
//! Start asynchronous worker thread. This is only used when
159-
//! there is a broken connection, leaving behind ProxyServerBase objects
160-
//! that need to be destroyed, in which case server ProxyServer::m_impl
161-
//! destructors don't have a dedicated thread to work and on shouldn't tie
162-
//! up the eventloop thread because it may need to do I/O on their behalf.
158+
//! Start asynchronous worker thread if necessary. This is only done if
159+
//! there are ProxyServerBase::m_impl objects that need to be destroyed
160+
//! asynchronously, without tying up the event loop thread. This can happen
161+
//! when an interface does not declare a destroy() method that would allow
162+
//! the client to wait for the destructor to finish and run it on a
163+
//! dedicated thread. It can also happen whenever this is a broken
164+
//! connection and the client is no longer around to call the destructors
165+
//! and the server objects need to be garbage collected. In both cases, it
166+
//! is important that ProxyServer::m_impl destructors do not run on the
167+
//! eventloop thread because they may need it to do I/O if they perform
168+
//! other IPC calls.
163169
void startAsyncThread(std::unique_lock<std::mutex>& lock);
164170

165171
//! Add/remove remote client reference counts.

0 commit comments

Comments
 (0)