MCPcopy Create free account
hub / github.com/Kitware/CMake / startProcessingMessages

Method startProcessingMessages

Utilities/cmcppdap/src/session.cpp:80–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 void startProcessingMessages(
81 const ClosedHandler& onClose /* = {} */) override {
82 if (isProcessingMessages.exchange(true)) {
83 handlers.error("Session::startProcessingMessages() called twice");
84 return;
85 }
86 recvThread = std::thread([this, onClose] {
87 while (reader.isOpen()) {
88 if (auto payload = getPayload()) {
89 inbox.put(std::move(payload));
90 }
91 }
92 if (onClose) {
93 onClose();
94 }
95 });
96
97 dispatchThread = std::thread([this] {
98 while (auto payload = inbox.take()) {
99 payload.value()();
100 }
101 });
102 }
103
104 bool send(const dap::TypeInfo* requestTypeInfo,
105 const dap::TypeInfo* responseTypeInfo,

Callers

nothing calls this directly

Calls 6

moveFunction · 0.85
takeMethod · 0.80
valueMethod · 0.80
errorMethod · 0.45
isOpenMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected