Skip to content

Commit aa3b695

Browse files
authored
Merge pull request #39742 from ktoso/pick-limit-width-linux-5.5
🍒 5.5 [Concurrency] Limit queue width with set_width SPI call on linux
2 parents 8386c77 + 0be0924 commit aa3b695

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/Concurrency/GlobalExecutor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static constexpr size_t globalQueueCacheCount =
266266
static_cast<size_t>(JobPriority::UserInteractive) + 1;
267267
static std::atomic<dispatch_queue_t> globalQueueCache[globalQueueCacheCount];
268268

269-
#ifdef SWIFT_CONCURRENCY_BACK_DEPLOYMENT
269+
#if defined(SWIFT_CONCURRENCY_BACK_DEPLOYMENT) || defined(__linux__)
270270
extern "C" void dispatch_queue_set_width(dispatch_queue_t dq, long width);
271271
#endif
272272

@@ -286,7 +286,7 @@ static dispatch_queue_t getGlobalQueue(JobPriority priority) {
286286
if (SWIFT_LIKELY(queue))
287287
return queue;
288288

289-
#ifdef SWIFT_CONCURRENCY_BACK_DEPLOYMENT
289+
#if defined(SWIFT_CONCURRENCY_BACK_DEPLOYMENT) || defined(__linux__)
290290
const int DISPATCH_QUEUE_WIDTH_MAX_LOGICAL_CPUS = -3;
291291

292292
// Create a new cooperative concurrent queue and swap it in.

0 commit comments

Comments
 (0)