Skip to content

Commit 4981dfd

Browse files
committed
merge darwin/libdispatch-1324.41.2
Signed-off-by: Rokhini Prabhu <rokhinip@apple.com>
2 parents 4fd4f40 + 3136e15 commit 4981dfd

File tree

117 files changed

+10909
-2353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+10909
-2353
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ int main(int argc, char *argv[]) {
4040
if(DISPATCH_HAVE_EXTENDED_SLPI_20348)
4141
add_compile_definitions(DISPATCH_HAVE_EXTENDED_SLPI_20348)
4242
endif()
43+
44+
check_c_source_compiles([=[
45+
#include <Windows.h>
46+
int main(int argc, char *argv[]) {
47+
switch ((LOGICAL_PROCESSOR_RELATIONSHIP)0) {
48+
case RelationProcessorModule:
49+
return 0;
50+
}
51+
return 0;
52+
}
53+
]=] DISPATCH_HAVE_EXTENDED_SLPI_22000)
54+
if(DISPATCH_HAVE_EXTENDED_SLPI_22000)
55+
add_compile_definitions(DISPATCH_HAVE_EXTENDED_SLPI_22000)
56+
endif()
4357
endif()
4458

4559
set(CMAKE_C_STANDARD 11)

PATCHES

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,3 +434,113 @@ github commits starting with 29bdc2f from
434434
[3975b58] APPLIED rdar://44568645
435435
[81dc900] APPLIED rdar://44568645
436436
[6162a1d] APPLIED rdar://44568645
437+
[c55ff6f] APPLIED rdar://54572081
438+
[c4a7149] APPLIED rdar://54572081
439+
[edce1fe] APPLIED rdar://54572081
440+
[ac525a4] APPLIED rdar://54572081
441+
[0710b29] APPLIED rdar://54572081
442+
[e99de71] APPLIED rdar://54572081
443+
[6d83ad5] APPLIED rdar://54572081
444+
[3ed78b5] APPLIED rdar://54572081
445+
[f6376cb] APPLIED rdar://54572081
446+
[9acbab3] APPLIED rdar://54572081
447+
[ca08b5f] APPLIED rdar://54572081
448+
[775f9f2] APPLIED rdar://54572081
449+
[db37bbc] APPLIED rdar://54572081
450+
[9852dcb] APPLIED rdar://54572081
451+
[9ec95bf] APPLIED rdar://54572081
452+
[bd2367c] APPLIED rdar://54572081
453+
[a736ea7] APPLIED rdar://54572081
454+
[3e4ea66] APPLIED rdar://54572081
455+
[c85c0d8] APPLIED rdar://54572081
456+
[7187ea2] APPLIED rdar://54572081
457+
[30eeb14] APPLIED rdar://54572081
458+
[6a5c6d8] APPLIED rdar://54572081
459+
[64a12c6] APPLIED rdar://54572081
460+
[09ec354] APPLIED rdar://54572081
461+
[5bcd598] APPLIED rdar://54572081
462+
[7874a92] APPLIED rdar://54572081
463+
[619775e] APPLIED rdar://54572081
464+
[e3ae79b] APPLIED rdar://54572081
465+
[fb368f6] APPLIED rdar://54572081
466+
[afa6cc3] APPLIED rdar://54572081
467+
[e6df818] APPLIED rdar://54572081
468+
[7144ee3] APPLIED rdar://54572081
469+
[60ffcc2] APPLIED rdar://54572081
470+
[618b070] APPLIED rdar://54572081
471+
[dde5892] APPLIED rdar://54572081
472+
[81c9bf6] APPLIED rdar://54572081
473+
[4b85ca6] APPLIED rdar://54572081
474+
[ff3bf51] APPLIED rdar://54572081
475+
[bc00e13] APPLIED rdar://54572081
476+
[d44acc0] APPLIED rdar://54572081
477+
[4659503] APPLIED rdar://54572081
478+
[60fdf80] APPLIED rdar://54572081
479+
[7a74af4] APPLIED rdar://54572081
480+
[f20349f] APPLIED rdar://54572081
481+
[ef9364c] APPLIED rdar://54572081
482+
[9d485ca] APPLIED rdar://54572081
483+
[cbd70d1] APPLIED rdar://54572081
484+
[6e1825a] APPLIED rdar://54572081
485+
[319bd33] APPLIED rdar://54572081
486+
[6c5b3ba] APPLIED rdar://54572081
487+
[7e7677b] APPLIED rdar://54572081
488+
[9002f70] APPLIED rdar://54572081
489+
[cc04868] APPLIED rdar://54572081
490+
[dc0dd64] APPLIED rdar://54572081
491+
[a5f5a92] APPLIED rdar://54572081
492+
[e5ba042] APPLIED rdar://54572081
493+
[a3bff44] APPLIED rdar://54572081
494+
[2e3d5c0] APPLIED rdar://54572081
495+
[1482ec9] APPLIED rdar://54572081
496+
[6bf6cb1] APPLIED rdar://54572081
497+
[aa13cad] APPLIED rdar://54572081
498+
[b073d89] APPLIED rdar://54572081
499+
[7784917] APPLIED rdar://54572081
500+
[717b3f7] APPLIED rdar://54572081
501+
[37010f0] APPLIED rdar://54572081
502+
[251dba4] APPLIED rdar://54572081
503+
[a18aa1f] APPLIED rdar://54572081
504+
[e8d020e] APPLIED rdar://54572081
505+
[90a84a1] APPLIED rdar://54572081
506+
[7721660] APPLIED rdar://54572081
507+
[c5af10f] APPLIED rdar://54572081
508+
[f01432d] APPLIED rdar://54572081
509+
[d0394bf] APPLIED rdar://54572081
510+
[2b14a98] APPLIED rdar://54572081
511+
[d32596b] APPLIED rdar://54572081
512+
[52bc6b2] APPLIED rdar://54572081
513+
[4169c8d] APPLIED rdar://54572081
514+
[318f6e5] APPLIED rdar://54572081
515+
[6a36af8] APPLIED rdar://54572081
516+
[d11d565] APPLIED rdar://54572081
517+
[d9740c2] APPLIED rdar://54572081
518+
[fc917b4] APPLIED rdar://54572081
519+
[f911a44] APPLIED rdar://54572081
520+
[6d32c4d] APPLIED rdar://54572081
521+
[9005cb4] APPLIED rdar://54572081
522+
[68875cb] APPLIED rdar://54572081
523+
[fc73866] APPLIED rdar://54572081
524+
[3cf1bf3] APPLIED rdar://54572081
525+
[3da29dd] APPLIED rdar://81276248
526+
[90a45ce] APPLIED rdar://81276248
527+
[37c8c28] APPLIED rdar://81276248
528+
[c023edd] APPLIED rdar://81276248
529+
[ab8a151] APPLIED rdar://81276248
530+
[c66cb25] APPLIED rdar://81276248
531+
[289e552] APPLIED rdar://81276248
532+
[afd6b6d] APPLIED rdar://81276248
533+
[4c91d20] APPLIED rdar://81276248
534+
[2accb0b] APPLIED rdar://81276248
535+
[b0b314c] APPLIED rdar://81276248
536+
[c992dac] APPLIED rdar://81276248
537+
[80b1772] APPLIED rdar://81276248
538+
[1986f39] APPLIED rdar://81276248
539+
[598ce42] APPLIED rdar://81276248
540+
[feb4421] APPLIED rdar://81276248
541+
[f152471] APPLIED rdar://81276248
542+
[457b110] APPLIED rdar://81276248
543+
[f13ea5d] APPLIED rdar://81276248
544+
[1c303fa] APPLIED rdar://81276248
545+
[34f383d] APPLIED rdar://81276248
546+
[7870521] APPLIED rdar://81276248

config/config.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
you don't. */
6262
#define HAVE_DECL_VQ_VERYLOWDISK 1
6363

64+
/* Define to 1 if you have the declaration of `VQ_SERVEREVENT', and to 0 if
65+
you don't. */
66+
#define HAVE_DECL_VQ_SERVEREVENT 1
67+
6468
/* Define to 1 if you have the declaration of `VQ_QUOTA', and to 0 if
6569
you don't. */
6670
#define HAVE_DECL_VQ_QUOTA 1
@@ -73,10 +77,6 @@
7377
you don't. */
7478
#define HAVE_DECL_VQ_DESIRED_DISK 1
7579

76-
/* Define to 1 if you have the declaration of `VQ_FREE_SPACE_CHANGE', and to 0 if
77-
you don't. */
78-
#define HAVE_DECL_VQ_FREE_SPACE_CHANGE 1
79-
8080
/* Define to 1 if you have the <dlfcn.h> header file. */
8181
#define HAVE_DLFCN_H 1
8282

@@ -125,6 +125,12 @@
125125
/* Define if you have the Objective-C runtime */
126126
#define HAVE_OBJC 1
127127

128+
/* Define to 1 if you have the `posix_fadvise' function. */
129+
#define HAVE_POSIX_FADVISE 0
130+
131+
/* Define to 1 if you have the `posix_spawnp' function. */
132+
#define HAVE_POSIX_SPAWNP 1
133+
128134
/* Define to 1 if you have the `pthread_key_init_np' function. */
129135
#define HAVE_PTHREAD_KEY_INIT_NP 1
130136

dispatch/base.h

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,35 @@
264264
#endif
265265
#endif
266266

267-
#if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) || defined(_WIN32)
267+
#if __has_attribute(enum_extensibility)
268+
#define __DISPATCH_ENUM_ATTR __attribute__((__enum_extensibility__(open)))
269+
#define __DISPATCH_ENUM_ATTR_CLOSED __attribute__((__enum_extensibility__(closed)))
270+
#else
271+
#define __DISPATCH_ENUM_ATTR
272+
#define __DISPATCH_ENUM_ATTR_CLOSED
273+
#endif // __has_attribute(enum_extensibility)
274+
275+
#if __has_attribute(flag_enum)
276+
#define __DISPATCH_OPTIONS_ATTR __attribute__((__flag_enum__))
277+
#else
278+
#define __DISPATCH_OPTIONS_ATTR
279+
#endif // __has_attribute(flag_enum)
280+
281+
282+
#if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) || \
283+
__has_extension(cxx_fixed_enum) || defined(_WIN32)
268284
#define DISPATCH_ENUM(name, type, ...) \
269-
typedef enum : type { __VA_ARGS__ } name##_t
285+
typedef enum : type { __VA_ARGS__ } __DISPATCH_ENUM_ATTR name##_t
286+
#define DISPATCH_OPTIONS(name, type, ...) \
287+
typedef enum : type { __VA_ARGS__ } __DISPATCH_OPTIONS_ATTR __DISPATCH_ENUM_ATTR name##_t
270288
#else
271289
#define DISPATCH_ENUM(name, type, ...) \
272-
enum { __VA_ARGS__ }; typedef type name##_t
273-
#endif
290+
enum { __VA_ARGS__ } __DISPATCH_ENUM_ATTR; typedef type name##_t
291+
#define DISPATCH_OPTIONS(name, type, ...) \
292+
enum { __VA_ARGS__ } __DISPATCH_OPTIONS_ATTR __DISPATCH_ENUM_ATTR; typedef type name##_t
293+
#endif // __has_feature(objc_fixed_enum) ...
294+
295+
274296

275297
#if __has_feature(enumerator_attributes)
276298
#define DISPATCH_ENUM_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__)
@@ -283,12 +305,11 @@
283305
#define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...)
284306
#endif
285307

286-
#if defined(SWIFT_SDK_OVERLAY_DISPATCH_EPOCH) && \
287-
SWIFT_SDK_OVERLAY_DISPATCH_EPOCH >= 2
308+
#ifdef __swift__
288309
#define DISPATCH_SWIFT3_OVERLAY 1
289-
#else
310+
#else // __swift__
290311
#define DISPATCH_SWIFT3_OVERLAY 0
291-
#endif // SWIFT_SDK_OVERLAY_DISPATCH_EPOCH >= 2
312+
#endif // __swift__
292313

293314
#if __has_feature(attribute_availability_swift)
294315
#define DISPATCH_SWIFT_UNAVAILABLE(_msg) \

dispatch/block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ __BEGIN_DECLS
100100
* for synchronous execution or when the dispatch block object is invoked
101101
* directly.
102102
*/
103-
DISPATCH_ENUM(dispatch_block_flags, unsigned long,
103+
DISPATCH_OPTIONS(dispatch_block_flags, unsigned long,
104104
DISPATCH_BLOCK_BARRIER
105105
DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x1,
106106
DISPATCH_BLOCK_DETACHED

dispatch/dispatch.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,15 @@
5454
#endif
5555
#endif
5656

57-
#define DISPATCH_API_VERSION 20180109
57+
#define DISPATCH_API_VERSION 20181008
5858

5959
#ifndef __DISPATCH_BUILDING_DISPATCH__
6060
#ifndef __DISPATCH_INDIRECT__
6161
#define __DISPATCH_INDIRECT__
6262
#endif
6363

6464
#include <os/object.h>
65+
#include <os/workgroup.h>
6566
#include <dispatch/base.h>
6667
#include <dispatch/time.h>
6768
#include <dispatch/object.h>
@@ -73,6 +74,7 @@
7374
#include <dispatch/once.h>
7475
#include <dispatch/data.h>
7576
#include <dispatch/io.h>
77+
#include <dispatch/workloop.h>
7678

7779
#undef __DISPATCH_INDIRECT__
7880
#endif /* !__DISPATCH_BUILDING_DISPATCH__ */

dispatch/object.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
#include <dispatch/base.h> // for HeaderDoc
2727
#endif
2828

29+
#if __has_include(<sys/qos.h>)
30+
#include <sys/qos.h>
31+
#endif
32+
2933
DISPATCH_ASSUME_NONNULL_BEGIN
3034

3135
/*!
@@ -95,6 +99,7 @@ typedef union {
9599
struct dispatch_queue_attr_s *_dqa;
96100
struct dispatch_group_s *_dg;
97101
struct dispatch_source_s *_ds;
102+
struct dispatch_channel_s *_dch;
98103
struct dispatch_mach_s *_dm;
99104
struct dispatch_mach_msg_s *_dmsg;
100105
struct dispatch_semaphore_s *_dsema;
@@ -178,6 +183,16 @@ typedef void (^dispatch_block_t)(void);
178183

179184
__BEGIN_DECLS
180185

186+
/*!
187+
* @typedef dispatch_qos_class_t
188+
* Alias for qos_class_t type.
189+
*/
190+
#if __has_include(<sys/qos.h>)
191+
typedef qos_class_t dispatch_qos_class_t;
192+
#else
193+
typedef unsigned int dispatch_qos_class_t;
194+
#endif
195+
181196
/*!
182197
* @function dispatch_retain
183198
*
@@ -374,6 +389,49 @@ DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
374389
void
375390
dispatch_resume(dispatch_object_t object);
376391

392+
/*!
393+
* @function dispatch_set_qos_class_floor
394+
*
395+
* @abstract
396+
* Sets the QOS class floor on a dispatch queue, source or workloop.
397+
*
398+
* @discussion
399+
* The QOS class of workitems submitted to this object asynchronously will be
400+
* elevated to at least the specified QOS class floor. The QOS of the workitem
401+
* will be used if higher than the floor even when the workitem has been created
402+
* without "ENFORCE" semantics.
403+
*
404+
* Setting the QOS class floor is equivalent to the QOS effects of configuring
405+
* a queue whose target queue has a QoS class set to the same value.
406+
*
407+
* @param object
408+
* A dispatch queue, workloop, or source to configure.
409+
* The object must be inactive.
410+
*
411+
* Passing another object type or an object that has been activated is undefined
412+
* and will cause the process to be terminated.
413+
*
414+
* @param qos_class
415+
* A QOS class value:
416+
* - QOS_CLASS_USER_INTERACTIVE
417+
* - QOS_CLASS_USER_INITIATED
418+
* - QOS_CLASS_DEFAULT
419+
* - QOS_CLASS_UTILITY
420+
* - QOS_CLASS_BACKGROUND
421+
* Passing any other value is undefined.
422+
*
423+
* @param relative_priority
424+
* A relative priority within the QOS class. This value is a negative
425+
* offset from the maximum supported scheduler priority for the given class.
426+
* Passing a value greater than zero or less than QOS_MIN_RELATIVE_PRIORITY
427+
* is undefined.
428+
*/
429+
API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
430+
DISPATCH_EXPORT DISPATCH_NOTHROW
431+
void
432+
dispatch_set_qos_class_floor(dispatch_object_t object,
433+
dispatch_qos_class_t qos_class, int relative_priority);
434+
377435
#ifdef __BLOCKS__
378436
/*!
379437
* @function dispatch_wait

0 commit comments

Comments
 (0)