From fc230cbbf5add14fc952a2d5e0b31b31bc2258e0 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 15 Aug 2022 22:52:03 -0400 Subject: [PATCH] Set the dispatch queue on system layer earlier in startup. (#21859) System layer init wants to use the queue. Fixes https://github.com/project-chip/connectedhomeip/issues/21857 --- src/platform/Darwin/PlatformManagerImpl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index e883f319305971..6102d1e599effc 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -55,7 +55,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() mRunLoopSem = dispatch_semaphore_create(0); // Ensure there is a dispatch queue available - GetWorkQueue(); + static_cast(DeviceLayer::SystemLayer()).SetDispatchQueue(GetWorkQueue()); // Call _InitChipStack() on the generic implementation base class // to finish the initialization process. @@ -70,8 +70,6 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() mStartTime = System::SystemClock().GetMonotonicTimestamp(); - static_cast(DeviceLayer::SystemLayer()).SetDispatchQueue(GetWorkQueue()); - exit: return err; }