From d10ad17199c5968059248c45437dbbac34e0aa69 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 9 Jul 2024 14:48:17 +0800 Subject: [PATCH] Do not wait forever to get fast enumeration state from file provider extension service Signed-off-by: Claudio Cambra --- src/gui/macOS/fileproviderxpc_mac.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/macOS/fileproviderxpc_mac.mm b/src/gui/macOS/fileproviderxpc_mac.mm index 9ccade29f6d5c..5db62867fb139 100644 --- a/src/gui/macOS/fileproviderxpc_mac.mm +++ b/src/gui/macOS/fileproviderxpc_mac.mm @@ -20,6 +20,10 @@ #include "gui/macOS/fileproviderdomainmanager.h" #include "gui/macOS/fileproviderxpc_mac_utils.h" +namespace { + constexpr int64_t semaphoreWaitDelta = 3000000000; // 3 seconds +} + namespace OCC::Mac { Q_LOGGING_CATEGORY(lcFileProviderXPC, "nextcloud.gui.macos.fileprovider.xpc", QtInfoMsg) @@ -154,7 +158,7 @@ receivedFastEnumerationSet = set; dispatch_semaphore_signal(semaphore); }]; - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); + dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, semaphoreWaitDelta)); return std::optional>{{receivedFastEnumerationEnabled, receivedFastEnumerationSet}}; }