Skip to content

Commit 763d0c7

Browse files
committed
merge darwin/libdispatch-806
2 parents fa4e3e3 + 1f28b9d commit 763d0c7

Some content is hidden

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

55 files changed

+3495
-2087
lines changed

config/config.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
you don't. */
6666
#define HAVE_DECL_VQ_QUOTA 1
6767

68+
/* Define to 1 if you have the declaration of `VQ_NEARLOWDISK', and to 0 if
69+
you don't. */
70+
#define HAVE_DECL_VQ_NEARLOWDISK 1
71+
72+
/* Define to 1 if you have the declaration of `VQ_DESIRED_DISK', and to 0 if
73+
you don't. */
74+
#define HAVE_DECL_VQ_DESIRED_DISK 1
75+
6876
/* Define to 1 if you have the <dlfcn.h> header file. */
6977
#define HAVE_DLFCN_H 1
7078

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ AC_CHECK_DECLS([NOTE_NONE, NOTE_REAP, NOTE_REVOKE, NOTE_SIGNAL, NOTE_LOWAT], [],
416416
[[#include <sys/event.h>]])
417417
AC_CHECK_DECLS([FD_COPY], [], [], [[#include <sys/select.h>]])
418418
AC_CHECK_DECLS([SIGEMT], [], [], [[#include <signal.h>]])
419-
AC_CHECK_DECLS([VQ_UPDATE, VQ_VERYLOWDISK, VQ_QUOTA], [], [], [[#include <sys/mount.h>]])
419+
AC_CHECK_DECLS([VQ_UPDATE, VQ_VERYLOWDISK, VQ_QUOTA, VQ_NEARLOWDISK, VQ_DESIRED_DISK], [], [], [[#include <sys/mount.h>]])
420420
AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
421421
AC_CHECK_FUNCS([pthread_key_init_np pthread_main_np mach_absolute_time mach_approximate_time malloc_create_zone sysconf])
422422

dispatch/base.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,14 @@
204204
#endif
205205

206206
#if __has_feature(enumerator_attributes)
207-
#define DISPATCH_ENUM_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__)
207+
#define DISPATCH_ENUM_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__)
208+
#define DISPATCH_ENUM_API_DEPRECATED(...) API_DEPRECATED(__VA_ARGS__)
209+
#define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...) \
210+
API_DEPRECATED_WITH_REPLACEMENT(__VA_ARGS__)
208211
#else
209-
#define DISPATCH_ENUM_AVAILABLE(...)
212+
#define DISPATCH_ENUM_API_AVAILABLE(...)
213+
#define DISPATCH_ENUM_API_DEPRECATED(...)
214+
#define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...)
210215
#endif
211216

212217
#if defined(SWIFT_SDK_OVERLAY_DISPATCH_EPOCH) && \
@@ -241,6 +246,12 @@
241246
#define DISPATCH_SWIFT_NAME(_name)
242247
#endif
243248

249+
#ifndef __cplusplus
250+
#define DISPATCH_TRANSPARENT_UNION __attribute__((__transparent_union__))
251+
#else
252+
#define DISPATCH_TRANSPARENT_UNION
253+
#endif
254+
244255
typedef void (*dispatch_function_t)(void *_Nullable);
245256

246257
#endif

dispatch/block.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ __BEGIN_DECLS
101101
*/
102102
DISPATCH_ENUM(dispatch_block_flags, unsigned long,
103103
DISPATCH_BLOCK_BARRIER
104-
DISPATCH_ENUM_AVAILABLE(macos(10.10), ios(8.0)) = 0x1,
104+
DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x1,
105105
DISPATCH_BLOCK_DETACHED
106-
DISPATCH_ENUM_AVAILABLE(macos(10.10), ios(8.0)) = 0x2,
106+
DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x2,
107107
DISPATCH_BLOCK_ASSIGN_CURRENT
108-
DISPATCH_ENUM_AVAILABLE(macos(10.10), ios(8.0)) = 0x4,
108+
DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x4,
109109
DISPATCH_BLOCK_NO_QOS_CLASS
110-
DISPATCH_ENUM_AVAILABLE(macos(10.10), ios(8.0)) = 0x8,
110+
DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x8,
111111
DISPATCH_BLOCK_INHERIT_QOS_CLASS
112-
DISPATCH_ENUM_AVAILABLE(macos(10.10), ios(8.0)) = 0x10,
112+
DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x10,
113113
DISPATCH_BLOCK_ENFORCE_QOS_CLASS
114-
DISPATCH_ENUM_AVAILABLE(macos(10.10), ios(8.0)) = 0x20,
114+
DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x20,
115115
);
116116

117117
/*!

dispatch/data.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ typedef bool (^dispatch_data_applier_t)(dispatch_data_t region,
250250
API_AVAILABLE(macos(10.7), ios(5.0))
251251
DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
252252
bool
253-
dispatch_data_apply(dispatch_data_t data, dispatch_data_applier_t applier);
253+
dispatch_data_apply(dispatch_data_t data,
254+
DISPATCH_NOESCAPE dispatch_data_applier_t applier);
254255
#endif /* __BLOCKS__ */
255256

256257
/*!

dispatch/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ typedef union {
9898
struct dispatch_io_s *_dchannel;
9999
struct dispatch_operation_s *_doperation;
100100
struct dispatch_disk_s *_ddisk;
101-
} dispatch_object_t __attribute__((__transparent_union__));
101+
} dispatch_object_t DISPATCH_TRANSPARENT_UNION;
102102
/*! @parseOnly */
103103
#define DISPATCH_DECL(name) typedef struct name##_s *name##_t
104104
/*! @parseOnly */

dispatch/queue.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,9 @@ dispatch_queue_attr_make_initially_inactive(
555555
* asynchronously. This is the behavior of the global concurrent queues.
556556
*/
557557
DISPATCH_ENUM(dispatch_autorelease_frequency, unsigned long,
558-
DISPATCH_AUTORELEASE_FREQUENCY_INHERIT DISPATCH_ENUM_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 0,
559-
DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM DISPATCH_ENUM_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 1,
560-
DISPATCH_AUTORELEASE_FREQUENCY_NEVER DISPATCH_ENUM_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 2,
558+
DISPATCH_AUTORELEASE_FREQUENCY_INHERIT DISPATCH_ENUM_API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 0,
559+
DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM DISPATCH_ENUM_API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 1,
560+
DISPATCH_AUTORELEASE_FREQUENCY_NEVER DISPATCH_ENUM_API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 2,
561561
);
562562

563563
/*!

dispatch/source.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ DISPATCH_SOURCE_TYPE_DECL(data_add);
9393
API_AVAILABLE(macos(10.6), ios(4.0))
9494
DISPATCH_SOURCE_TYPE_DECL(data_or);
9595

96+
/*!
97+
* @const DISPATCH_SOURCE_TYPE_DATA_REPLACE
98+
* @discussion A dispatch source that tracks data obtained via calls to
99+
* dispatch_source_merge_data(). Newly obtained data values replace existing
100+
* data values not yet delivered to the source handler
101+
*
102+
* A data value of zero will cause the source handler to not be invoked.
103+
*
104+
* The handle is unused (pass zero for now).
105+
* The mask is unused (pass zero for now).
106+
*/
107+
#define DISPATCH_SOURCE_TYPE_DATA_REPLACE (&_dispatch_source_type_data_replace)
108+
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
109+
DISPATCH_SOURCE_TYPE_DECL(data_replace);
110+
96111
/*!
97112
* @const DISPATCH_SOURCE_TYPE_MACH_SEND
98113
* @discussion A dispatch source that monitors a Mach port for dead name

libdispatch.xcodeproj/project.pbxproj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,8 @@
658658
6EB4E4421BA8BD7800D7B9D2 /* libfirehose.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = libfirehose.xcconfig; sourceTree = "<group>"; };
659659
6EB60D291BBB19640092FA94 /* firehose_inline_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = firehose_inline_internal.h; sourceTree = "<group>"; };
660660
6EC5ABE31D4436E4004F8674 /* dispatch_deadname.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dispatch_deadname.c; sourceTree = "<group>"; };
661+
6EC670C71E37E201004F10D6 /* perf_mach_async.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = perf_mach_async.c; sourceTree = "<group>"; };
662+
6EC670C81E37E201004F10D6 /* perf_pipepingpong.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = perf_pipepingpong.c; sourceTree = "<group>"; };
661663
6EDB888D1CB73BDC006776D6 /* dispatch_kevent_cancel_races.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dispatch_kevent_cancel_races.c; sourceTree = "<group>"; };
662664
6EDF10831BBB487E007F14BF /* firehose_buffer_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = firehose_buffer_private.h; sourceTree = "<group>"; };
663665
6EE89F3D1BFAF5B000EB140D /* dispatch_state_machine.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dispatch_state_machine.c; sourceTree = "<group>"; };
@@ -699,6 +701,9 @@
699701
96BC39BC0F3EBAB100C59689 /* queue_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = queue_private.h; sourceTree = "<group>"; };
700702
96C9553A0F3EAEDD000D2CA4 /* once.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = once.h; sourceTree = "<group>"; };
701703
96DF70BD0F38FE3C0074BD99 /* once.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; path = once.c; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.c; };
704+
B6AE9A4A1D7F53B300AC007F /* dispatch_queue_create.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dispatch_queue_create.c; sourceTree = "<group>"; };
705+
B6AE9A561D7F53C100AC007F /* perf_async_bench.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = perf_async_bench.m; sourceTree = "<group>"; };
706+
B6AE9A581D7F53CB00AC007F /* perf_bench.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = perf_bench.m; sourceTree = "<group>"; };
702707
C00B0E0A1C5AEBBE000330B3 /* libdispatch_dyld_stub.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdispatch_dyld_stub.a; sourceTree = BUILT_PRODUCTS_DIR; };
703708
C00B0E121C5AEBF7000330B3 /* libdispatch-dyld-stub.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "libdispatch-dyld-stub.xcconfig"; sourceTree = "<group>"; };
704709
C01866BD1C5973210040FC07 /* libdispatch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdispatch.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -1002,15 +1007,16 @@
10021007
6E67D90D1C16CCEB00FC98AC /* dispatch_debug.c */,
10031008
6E8E4ECB1C1A72650004F5CC /* dispatch_drift.c */,
10041009
6E67D90F1C16CF0B00FC98AC /* dispatch_group.c */,
1005-
6EDB888D1CB73BDC006776D6 /* dispatch_kevent_cancel_races.c */,
10061010
6E326ABD1C22A577002A6505 /* dispatch_io_net.c */,
10071011
6E326ABE1C22A577002A6505 /* dispatch_io.c */,
1012+
6EDB888D1CB73BDC006776D6 /* dispatch_kevent_cancel_races.c */,
10081013
C96CE17A1CEB851600F4B8E6 /* dispatch_objc.m */,
10091014
6E67D9131C17676D00FC98AC /* dispatch_overcommit.c */,
10101015
6E67D9151C1768B300FC98AC /* dispatch_pingpong.c */,
10111016
6E326B441C239B61002A6505 /* dispatch_priority.c */,
10121017
6E326AB51C225477002A6505 /* dispatch_proc.c */,
10131018
6E326AB31C224870002A6505 /* dispatch_qos.c */,
1019+
B6AE9A4A1D7F53B300AC007F /* dispatch_queue_create.c */,
10141020
6E67D9111C17669C00FC98AC /* dispatch_queue_finalizer.c */,
10151021
6E1612691C79606E006FC9A9 /* dispatch_queue_label.c */,
10161022
6E326AB91C229866002A6505 /* dispatch_read.c */,
@@ -1035,6 +1041,10 @@
10351041
6E326AB71C225FCA002A6505 /* dispatch_vnode.c */,
10361042
6E67D9171C17BA7200FC98AC /* nsoperation.m */,
10371043
6E4FC9D11C84123600520351 /* os_venture_basic.c */,
1044+
B6AE9A561D7F53C100AC007F /* perf_async_bench.m */,
1045+
B6AE9A581D7F53CB00AC007F /* perf_bench.m */,
1046+
6EC670C71E37E201004F10D6 /* perf_mach_async.c */,
1047+
6EC670C81E37E201004F10D6 /* perf_pipepingpong.c */,
10381048
92F3FE921BEC686300025962 /* Makefile */,
10391049
6E8E4E6E1C1A35EE0004F5CC /* test_lib.c */,
10401050
6E8E4E6F1C1A35EE0004F5CC /* test_lib.h */,
@@ -1682,7 +1692,7 @@
16821692
isa = PBXProject;
16831693
attributes = {
16841694
BuildIndependentTargetsInParallel = YES;
1685-
LastUpgradeCheck = 0810;
1695+
LastUpgradeCheck = 0820;
16861696
TargetAttributes = {
16871697
3F3C9326128E637B0042B1F7 = {
16881698
ProvisioningStyle = Manual;

man/dispatch_source_create.3

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ DISPATCH_SOURCE_TYPE_DATA_ADD
113113
.It
114114
DISPATCH_SOURCE_TYPE_DATA_OR
115115
.It
116+
DISPATCH_SOURCE_TYPE_DATA_REPLACE
117+
.It
116118
DISPATCH_SOURCE_TYPE_MACH_SEND
117119
.It
118120
DISPATCH_SOURCE_TYPE_MACH_RECV
@@ -168,12 +170,34 @@ The result of calling this function from any other context is undefined.
168170
The
169171
.Fn dispatch_source_merge_data
170172
function is intended for use with the
171-
.Vt DISPATCH_SOURCE_TYPE_DATA_ADD
172-
and
173+
.Vt DISPATCH_SOURCE_TYPE_DATA_ADD ,
173174
.Vt DISPATCH_SOURCE_TYPE_DATA_OR
175+
and
176+
.Vt DISPATCH_SOURCE_TYPE_DATA_REPLACE
174177
source types. The result of using this function with any other source type is
175-
undefined. Calling this function will atomically add or bitwise OR the data
176-
into the source's data, and trigger the delivery of the source's event handler.
178+
undefined. Data merging is performed according to the source type:
179+
.Bl -tag -width "XXDISPATCH_SOURCE_TYPE_DATA_REPLACE" -compact -offset indent
180+
.It \(bu DISPATCH_SOURCE_TYPE_DATA_ADD
181+
.Vt data
182+
is atomically added to the source's data
183+
.It \(bu DISPATCH_SOURCE_TYPE_DATA_OR
184+
.Vt data
185+
is atomically bitwise ORed into the source's data
186+
.It \(bu DISPATCH_SOURCE_TYPE_DATA_REPLACE
187+
.Vt data
188+
atomically replaces the source's data.
189+
.El
190+
.Pp
191+
If the source data value resulting from the merge operation is 0, the source
192+
handler will not be invoked. This can happen if:
193+
.Bl -bullet -compact -offset indent
194+
.It
195+
the atomic addition wraps for sources of type
196+
.Vt DISPATCH_SOURCE_TYPE_DATA_ADD ,
197+
.It
198+
0 is merged for sources of type
199+
.Vt DISPATCH_SOURCE_TYPE_DATA_REPLACE .
200+
.El
177201
.Pp
178202
.Sh SOURCE EVENT HANDLERS
179203
In order to receive events from the dispatch source, an event handler should be
@@ -265,14 +289,15 @@ The following section contains a summary of supported dispatch event types and
265289
the interpretation of their parameters and returned data.
266290
.Pp
267291
.Vt DISPATCH_SOURCE_TYPE_DATA_ADD ,
268-
.Vt DISPATCH_SOURCE_TYPE_DATA_OR
292+
.Vt DISPATCH_SOURCE_TYPE_DATA_OR ,
293+
.Vt DISPATCH_SOURCE_TYPE_DATA_REPLACE
269294
.Pp
270295
Sources of this type allow applications to manually trigger the source's event
271296
handler via a call to
272297
.Fn dispatch_source_merge_data .
273298
The data will be merged with the source's pending data via an atomic add or
274-
atomic bitwise OR (based on the source's type), and the event handler block will
275-
be submitted to the source's target queue. The
299+
atomic bitwise OR, or direct replacement (based on the source's type), and the
300+
event handler block will be submitted to the source's target queue. The
276301
.Fa data
277302
is application defined. These sources have no
278303
.Fa handle
@@ -499,19 +524,6 @@ was created with
499524
the timer is based on
500525
.Xr gettimeofday 3 .
501526
.Pp
502-
.Em Note :
503-
Under the C language, untyped numbers default to the
504-
.Vt int
505-
type. This can lead to truncation bugs when arithmetic operations with other
506-
numbers are expected to generate a
507-
.Vt uint64_t
508-
sized result. When in doubt, use
509-
.Vt ull
510-
as a suffix. For example:
511-
.Bd -literal -offset indent
512-
3ull * NSEC_PER_SEC
513-
.Ed
514-
.Pp
515527
.Vt DISPATCH_SOURCE_TYPE_VNODE
516528
.Pp
517529
Sources of this type monitor the virtual filesystem nodes for state changes.

man/dispatch_time.3

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,10 @@ parameter is ignored.
8080
.Pp
8181
Underflow causes the smallest representable value to be
8282
returned for a given clock.
83-
.Sh CAVEATS
84-
Under the C language, untyped numbers default to the
85-
.Vt int
86-
type. This can lead to truncation bugs when arithmetic operations with other
87-
numbers are expected to generate a
88-
.Vt int64_t
89-
sized result, such as the
90-
.Fa offset
91-
argument to
92-
.Fn dispatch_time
93-
and
94-
.Fn dispatch_walltime .
95-
When in doubt, use
96-
.Vt ull
97-
as a suffix. For example:
98-
.Bd -literal -offset indent
99-
3ull * NSEC_PER_SEC
100-
.Ed
10183
.Sh EXAMPLES
10284
Create a milestone two seconds in the future:
10385
.Bd -literal -offset indent
104-
milestone = dispatch_time(DISPATCH_TIME_NOW, 2LL * NSEC_PER_SEC);
86+
milestone = dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC);
10587
.Ed
10688
.Pp
10789
Create a milestone for use as an infinite timeout:
@@ -116,6 +98,11 @@ ts.tv_sec = 0x7FFFFFFF;
11698
ts.tv_nsec = 0;
11799
milestone = dispatch_walltime(&ts, 0);
118100
.Ed
101+
.Pp
102+
Use a negative delta to create a milestone an hour before the one above:
103+
.Bd -literal -offset indent
104+
milestone = dispatch_walltime(&ts, -60 * 60 * NSEC_PER_SEC);
105+
.Ed
119106
.Sh RETURN VALUE
120107
These functions return an abstract value for use with
121108
.Fn dispatch_after ,

os/firehose_server_private.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,32 @@ OS_NOTHROW OS_NONNULL1
139139
uint64_t
140140
firehose_client_get_unique_pid(firehose_client_t client, pid_t *pid);
141141

142+
/*!
143+
* @function firehose_client_get_pid_version
144+
*
145+
* @abstract
146+
* Returns the pid version for that client.
147+
*
148+
* @param client
149+
* The specified client.
150+
*/
151+
OS_NOTHROW OS_NONNULL1
152+
int
153+
firehose_client_get_pid_version(firehose_client_t client);
154+
155+
/*!
156+
* @function firehose_client_get_euid
157+
*
158+
* @abstract
159+
* Returns the EUID for that client as discovered at connect time.
160+
*
161+
* @param client
162+
* The specified client.
163+
*/
164+
OS_NOTHROW OS_NONNULL1
165+
uid_t
166+
firehose_client_get_euid(firehose_client_t client);
167+
142168
/*!
143169
* @function firehose_client_get_metadata_buffer
144170
*
@@ -276,6 +302,20 @@ OS_NOTHROW
276302
void
277303
firehose_server_assert_spi_version(uint32_t spi_version);
278304

305+
/*!
306+
* @function firehose_server_has_ever_flushed_pages
307+
*
308+
* @abstract
309+
* Checks whether the firehose server has ever flushed any pages this boot.
310+
*
311+
* @discussion
312+
* Must be called after firehose_server_init() and before calling
313+
* firehose_server_resume().
314+
*/
315+
OS_NOTHROW
316+
bool
317+
firehose_server_has_ever_flushed_pages(void);
318+
279319
/*!
280320
* @function firehose_server_resume
281321
*
@@ -289,6 +329,16 @@ OS_NOTHROW
289329
void
290330
firehose_server_resume(void);
291331

332+
/*!
333+
* @function firehose_server_cancel
334+
*
335+
* @abstract
336+
* Cancels the server, disconnects all clients, and prevents new connections.
337+
*/
338+
OS_NOTHROW
339+
void
340+
firehose_server_cancel(void);
341+
292342
/*!
293343
* @typedef firehose_server_queue_t
294344
*

os/object.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
#endif // OS_OBJECT_HAVE_OBJC_SUPPORT
7777

7878
#if OS_OBJECT_HAVE_OBJC_SUPPORT
79+
#if defined(__swift__) && __swift__ && !OS_OBJECT_USE_OBJC
80+
#define OS_OBJECT_USE_OBJC 1
81+
#endif
7982
#ifndef OS_OBJECT_USE_OBJC
8083
#define OS_OBJECT_USE_OBJC 1
8184
#endif

0 commit comments

Comments
 (0)