From 149863def52aec99dc9498404eb98d0bb4b42bb6 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Wed, 26 Apr 2023 20:41:09 +0200 Subject: [PATCH] Update src/platform/tests/TestDnssd.cpp Co-authored-by: Boris Zbarsky --- src/platform/tests/TestDnssd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platform/tests/TestDnssd.cpp b/src/platform/tests/TestDnssd.cpp index 3006b00f0155e9..1102e1d3c5c665 100644 --- a/src/platform/tests/TestDnssd.cpp +++ b/src/platform/tests/TestDnssd.cpp @@ -83,6 +83,9 @@ static void HandleResolve(void * context, DnssdService * result, const chip::Spa if (ctx->mBrowsedServicesCount == ++ctx->mResolvedServicesCount) { chip::DeviceLayer::SystemLayer().CancelTimer(Timeout, context); + // StopEventLoopTask needs to be called from inside the Matter event loop, but we + // might not be in there right now; instead we might be on some other thread, but + // holding the Matter lock. chip::DeviceLayer::SystemLayer().ScheduleLambda([]() { // After last service is resolved, stop the event loop, // so the test case can gracefully exit.