diff --git a/include/mp/type-context.h b/include/mp/type-context.h index 3733d6b..72c3963 100644 --- a/include/mp/type-context.h +++ b/include/mp/type-context.h @@ -123,7 +123,7 @@ auto PassField(Priority<1>, TypeList<>, ServerContext& server_context, const Fn& // it. So in addition to locking the mutex, the // execution thread always checks request_canceled // as well before accessing the structs. - Lock{cancel_mutex}; + Lock cancel_lock{cancel_mutex}; server_context.request_canceled = true; }; // Update requests_threads map if not canceled. @@ -210,7 +210,7 @@ auto PassField(Priority<1>, TypeList<>, ServerContext& server_context, const Fn& // connection is destroyed. (By default Cap'n Proto does not cancel requests // on disconnect, since it's possible clients might want to make requests // and immediately disconnect without waiting for results, but not want the - // the requests to be canceled.) + // requests to be canceled.) return server.m_context.connection->m_canceler.wrap(kj::mv(result)); } } // namespace mp diff --git a/include/mp/util.h b/include/mp/util.h index 80791bd..a3db128 100644 --- a/include/mp/util.h +++ b/include/mp/util.h @@ -331,7 +331,7 @@ void CancelMonitor::promiseDestroyed(CancelProbe& probe) // theory this method could be called when a promise was fulfilled or // rejected rather than canceled, but it's safe to assume that's not the // case because the CancelMonitor class is meant to be used inside code - // fulfilling or rejecting the promise and destroyed before doing these. + // fulfilling or rejecting the promise and destroyed before doing so. assert(m_probe == &probe); m_canceled = true; if (m_on_cancel) m_on_cancel();