Skip to content

Commit 056832d

Browse files
committed
Assign properties to dispatch_queue_attr_concurrent on Linux
1 parent 31586d5 commit 056832d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/init.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,21 @@ const struct dispatch_queue_attr_s _dispatch_queue_attrs[]
260260
DISPATCH_QUEUE_ATTR_QOS_INITIALIZER(USER_INTERACTIVE),
261261
};
262262

263+
#ifndef __APPLE__
264+
// _dispatch_queue_attr_concurrent is only aliased on Darwin where the
265+
// -alias_list linker option exists. On other platforms we need to assign
266+
// the structure and properties directly.
267+
struct dispatch_queue_attr_s _dispatch_queue_attr_concurrent = {
268+
.do_vtable = DISPATCH_VTABLE(queue_attr),
269+
.do_ref_cnt = DISPATCH_OBJECT_GLOBAL_REFCNT,
270+
.do_xref_cnt = DISPATCH_OBJECT_GLOBAL_REFCNT,
271+
.do_next = DISPATCH_OBJECT_LISTLESS,
272+
.dqa_qos_class = _DISPATCH_QOS_CLASS_UNSPECIFIED,
273+
.dqa_relative_priority = 0,
274+
.dqa_overcommit = _dispatch_queue_attr_overcommit_unspecified,
275+
.dqa_concurrent = 1
276+
};
277+
#endif
263278

264279
#pragma mark -
265280
#pragma mark dispatch_vtables

0 commit comments

Comments
 (0)