object.h
IntroductionUse the links in the table of contents to the left to access the documentation. Functions
_dispatch_object_validateAbstract base type for all dispatch objects. The details of the type definition are language-specific. void _dispatch_object_validate( dispatch_object_t object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_cancel(void *)Cancel the specified object. DISPATCH_UNAVAILABLE void dispatch_cancel( void *object); Parameters
DiscussionType-generic macro that maps to dispatch_block_cancel or dispatch_source_cancel, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_cancel(void *)Cancel the specified object. DISPATCH_UNAVAILABLE void dispatch_cancel( void *object); Parameters
DiscussionType-generic macro that maps to dispatch_block_cancel or dispatch_source_cancel, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_notify(void *, dispatch_object_t, dispatch_block_t)Schedule a notification block to be submitted to a queue when the execution of a specified object has completed. DISPATCH_UNAVAILABLE void dispatch_notify( void *object, dispatch_object_t queue, dispatch_block_t notification_block); Parameters
DiscussionType-generic macro that maps to dispatch_block_notify or dispatch_group_notify, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_notify(void *, dispatch_object_t, dispatch_block_t)Schedule a notification block to be submitted to a queue when the execution of a specified object has completed. DISPATCH_UNAVAILABLE void dispatch_notify( void *object, dispatch_object_t queue, dispatch_block_t notification_block); Parameters
DiscussionType-generic macro that maps to dispatch_block_notify or dispatch_group_notify, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. /* * Dispatch objects are NOT C++ objects. Nevertheless, we can at least keep C++ * aware of type compatibility. */ typedef struct dispatch_object_s { private: dispatch_object_s(); ~dispatch_object_s(); dispatch_object_s( const dispatch_object_s &); void operator=( const dispatch_object_s &); } *dispatch_object_t; DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_t(dispatch_object)Abstract base type for all dispatch objects. The details of the type definition are language-specific. /* * By default, dispatch objects are declared as Objective-C types when building * with an Objective-C compiler. This allows them to participate in ARC, in RR * management by the Blocks runtime and in leaks checking by the static * analyzer, and enables them to be added to Cocoa collections. * See <os/object.h> for details. */ OS_OBJECT_DECL_CLASS( dispatch_object); DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_t(dispatch_object_t)Abstract base type for all dispatch objects. The details of the type definition are language-specific. void _dispatch_object_validate( dispatch_object_t object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_testcancel(void *)Test whether the specified object has been canceled DISPATCH_UNAVAILABLE intptr_t dispatch_testcancel( void *object); Parameters
Return ValueNon-zero if canceled and zero if not canceled. DiscussionType-generic macro that maps to dispatch_block_testcancel or dispatch_source_testcancel, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_testcancel(void *)Test whether the specified object has been canceled DISPATCH_UNAVAILABLE intptr_t dispatch_testcancel( void *object); Parameters
DiscussionType-generic macro that maps to dispatch_block_testcancel or dispatch_source_testcancel, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_wait(void *, dispatch_time_t)Wait synchronously for an object or until the specified timeout has elapsed. DISPATCH_UNAVAILABLE DISPATCH_NONNULL1 intptr_t dispatch_wait( void *object, dispatch_time_t timeout); Parameters
Return ValueReturns zero on success or non-zero on error (i.e. timed out). DiscussionType-generic macro that maps to dispatch_block_wait, dispatch_group_wait or dispatch_semaphore_wait, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_wait(void *, dispatch_time_t)Wait synchronously for an object or until the specified timeout has elapsed. DISPATCH_UNAVAILABLE DISPATCH_NONNULL1 intptr_t dispatch_wait( void *object, dispatch_time_t timeout); Parameters
DiscussionType-generic macro that maps to dispatch_block_wait, dispatch_group_wait or dispatch_semaphore_wait, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
operator dispatch_object_sAbstract base type for all dispatch objects. The details of the type definition are language-specific. /* * Dispatch objects are NOT C++ objects. Nevertheless, we can at least keep C++ * aware of type compatibility. */ typedef struct dispatch_object_s { private: dispatch_object_s(); ~dispatch_object_s(); dispatch_object_s( const dispatch_object_s &); void operator=( const dispatch_object_s &); } *dispatch_object_t; DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
operator dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. /* * Dispatch objects are NOT C++ objects. Nevertheless, we can at least keep C++ * aware of type compatibility. */ typedef struct dispatch_object_s { private: dispatch_object_s(); ~dispatch_object_s(); dispatch_object_s( const dispatch_object_s &); void operator=( const dispatch_object_s &); } *dispatch_object_t; DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
OS_OBJECT_DECL_CLASSAbstract base type for all dispatch objects. The details of the type definition are language-specific. /* * By default, dispatch objects are declared as Objective-C types when building * with an Objective-C compiler. This allows them to participate in ARC, in RR * management by the Blocks runtime and in leaks checking by the static * analyzer, and enables them to be added to Cocoa collections. * See <os/object.h> for details. */ OS_OBJECT_DECL_CLASS( dispatch_object); DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
Typedefs
dispatch_block_tThe type of blocks submitted to dispatch queues, which take no arguments and have no return value. typedef void (^dispatch_block_t)( void); DiscussionWhen not building with Objective-C ARC, a block object allocated on or copied to the heap must be released with a -[release] message or the Block_release() function. The declaration of a block literal allocates storage on the stack.
Therefore, this is an invalid construct:
What is happening behind the scenes:
As the example demonstrates, the address of a stack variable is escaping the scope in which it is allocated. That is a classic C bug. Instead, the block literal must be copied to the heap with the Block_copy() function or by sending it a -[copy] message. See Also
dispatch_object_tProgrammatically log debug information about a dispatch object. #if ( OS_OBJECT_USE_OBJC) /* * By default, dispatch objects are declared as Objective-C types when building * with an Objective-C compiler. This allows them to participate in ARC, in RR * management by the Blocks runtime and in leaks checking by the static * analyzer, and enables them to be added to Cocoa collections. * See <os/object.h> for details. */ OS_OBJECT_DECL_CLASS( dispatch_object); #if ( OS_OBJECT_SWIFT3) #define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, dispatch_object) #define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, base) #else // OS_OBJECT_SWIFT3 #define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS(name, dispatch_object) #define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS(name, base) void _dispatch_object_validate( dispatch_object_t object) #endif // OS_OBJECT_SWIFT3 #define DISPATCH_GLOBAL_OBJECT(type, object) #define DISPATCH_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED #if ( defined(__cplusplus) && !defined(__DISPATCH_BUILDING_DISPATCH__)) /* * Dispatch objects are NOT C++ objects. Nevertheless, we can at least keep C++ * aware of type compatibility. */ typedef struct dispatch_object_s { private: dispatch_object_s(); ~dispatch_object_s(); dispatch_object_s( const dispatch_object_s &); void operator=( const dispatch_object_s &); } *dispatch_object_t; #define DISPATCH_DECL(name) \ typedef struct name##_s : public dispatch_object_s {} *name##_t #define DISPATCH_DECL_SUBCLASS(name, base) \ typedef struct name##_s : public base##_s {} *name##_t #define DISPATCH_GLOBAL_OBJECT(type, object) #define DISPATCH_RETURNS_RETAINED #else /* Plain C */ #if (ndef __DISPATCH_BUILDING_DISPATCH__) typedef union { struct _os_object_s *_os_obj; struct dispatch_object_s *_do; struct dispatch_queue_s *_dq; struct dispatch_queue_attr_s *_dqa; struct dispatch_group_s *_dg; struct dispatch_source_s *_ds; struct dispatch_mach_s *_dm; struct dispatch_mach_msg_s *_dmsg; struct dispatch_semaphore_s *_dsema; struct dispatch_data_s *_ddata; struct dispatch_io_s *_dchannel; } dispatch_object_t DISPATCH_TRANSPARENT_UNION; #endif // !__DISPATCH_BUILDING_DISPATCH__ #define DISPATCH_DECL(name) typedef struct name##_s *name##_t #define DISPATCH_DECL_SUBCLASS(name, base) typedef base##_t name##_t #define DISPATCH_GLOBAL_OBJECT(type, object) #define DISPATCH_RETURNS_RETAINED #endif #if ( OS_OBJECT_SWIFT3 && OS_OBJECT_USE_OBJC) #define DISPATCH_SOURCE_TYPE_DECL(name) \ struct dispatch_source_type_s \ _dispatch_source_type_##name; \ OS_OBJECT_DECL_PROTOCOL(dispatch_source_##name, <OS_dispatch_source>); \ OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL( \ dispatch_source, dispatch_source_##name) #define DISPATCH_SOURCE_DECL(name) \ typedef struct name_s *name_t; \ OS_OBJECT_DECL_PROTOCOL(name, <NSObject>); \ OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL(name, name) #if (ndef typedef struct name_s *name_t OS_OBJECT_DECL_SWIFT(name) #endif // DISPATCH_DATA_DECL #else #define DISPATCH_SOURCE_DECL(name) \ typedef struct name_s *name_t; #define DISPATCH_DATA_DECL(name) typedef struct name_s *name_t #define DISPATCH_SOURCE_TYPE_DECL(name) \ const struct dispatch_source_type_s \ _dispatch_source_type_##name #endif #if (defined( 1)) typedef void (^dispatch_block_t)( void); #endif // __BLOCKS__ ( macos( 10.6), ios( 4.0)) void dispatch_retain( dispatch_object_t object); #if ( OS_OBJECT_USE_OBJC_RETAIN_RELEASE) #define dispatch_retain(object) \ __extension__({ dispatch_object_t _o = (object); \ _dispatch_object_validate(_o); (void)[_o retain]; }) #endif ( macos( 10.6), ios( 4.0)) void dispatch_release( dispatch_object_t object); #if ( OS_OBJECT_USE_OBJC_RETAIN_RELEASE) #define dispatch_release(object) \ __extension__({ dispatch_object_t _o = (object); \ _dispatch_object_validate(_o); [_o release]; }) #endif ( macos( 10.6), ios( 4.0)) void *_Nullable dispatch_get_context( dispatch_object_t object); ( macos( 10.6), ios( 4.0)) void dispatch_set_context( dispatch_object_t object, void *_Nullable context); ( macos( 10.6), ios( 4.0)) void dispatch_set_finalizer_f( dispatch_object_t object, dispatch_function_t _Nullable finalizer); ( macos( 10.12), ios( 10.0), tvos( 10.0), watchos( 3.0)) void dispatch_activate( dispatch_object_t object); ( macos( 10.6), ios( 4.0)) void dispatch_suspend( dispatch_object_t object); ( macos( 10.6), ios( 4.0)) void dispatch_resume( dispatch_object_t object); #if (defined( 1)) DISPATCH_UNAVAILABLE DISPATCH_NONNULL1 intptr_t dispatch_wait( void *object, dispatch_time_t timeout); #if ( __has_extension(c_generic_selections)) #define dispatch_wait(object, timeout) \ _Generic((object), \ dispatch_block_t:dispatch_block_wait, \ dispatch_group_t:dispatch_group_wait, \ dispatch_semaphore_t:dispatch_semaphore_wait \ )((object),(timeout)) #endif DISPATCH_UNAVAILABLE void dispatch_notify( void *object, dispatch_object_t queue, dispatch_block_t notification_block); #if ( __has_extension(c_generic_selections)) #define dispatch_notify(object, queue, notification_block) \ _Generic((object), \ dispatch_block_t:dispatch_block_notify, \ dispatch_group_t:dispatch_group_notify \ )((object),(queue), (notification_block)) #endif DISPATCH_UNAVAILABLE void dispatch_cancel( void *object); #if ( __has_extension(c_generic_selections)) #define dispatch_cancel(object) \ _Generic((object), \ dispatch_block_t:dispatch_block_cancel, \ dispatch_source_t:dispatch_source_cancel \ )((object)) #endif DISPATCH_UNAVAILABLE intptr_t dispatch_testcancel( void *object); #if ( __has_extension(c_generic_selections)) #define dispatch_testcancel(object) \ _Generic((object), \ dispatch_block_t:dispatch_block_testcancel, \ dispatch_source_t:dispatch_source_testcancel \ )((object)) #endif #endif // __BLOCKS__ ( "unsupported interface", macos( 10.6, 10.9), ios( 4.0, 6.0)) DISPATCH_NONNULL2 DISPATCH_COLD __attribute__((__format__(printf, 2,3))) void dispatch_debug( dispatch_object_t object, const char *message, ...); ( "unsupported interface", macos( 10.6, 10.9), ios( 4.0, 6.0)) DISPATCH_NONNULL2 DISPATCH_COLD __attribute__((__format__(printf, 2,0))) void dispatch_debugv( dispatch_object_t object, const char *message, va_list ap); DISPATCH_ASSUME_NONNULL_END #endif /* __DISPATCH_OBJECT__ */ Parameters
Return ValueNon-zero if canceled and zero if not canceled. DiscussionProgrammatically log debug information about a dispatch object. By default, the log output is sent to syslog at notice level. In the debug version of the library, the log output is sent to a file in /var/tmp. The log output destination can be configured via the LIBDISPATCH_LOG environment variable, valid values are: YES, NO, syslog, stderr, file. This function is deprecated and will be removed in a future release. Objective-C callers may use -debugDescription instead. See Also
DISPATCH_TRANSPARENT_UNIONAbstract base type for all dispatch objects. The details of the type definition are language-specific. typedef union { struct _os_object_s *_os_obj; struct dispatch_object_s *_do; struct dispatch_queue_s *_dq; struct dispatch_queue_attr_s *_dqa; struct dispatch_group_s *_dg; struct dispatch_source_s *_ds; struct dispatch_mach_s *_dm; struct dispatch_mach_msg_s *_dmsg; struct dispatch_semaphore_s *_dsema; struct dispatch_data_s *_ddata; struct dispatch_io_s *_dchannel; } dispatch_object_t DISPATCH_TRANSPARENT_UNION; DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
Macro Definitions
dispatch_cancelCancel the specified object. #define dispatch_cancel(object) \ _Generic((object), \ dispatch_block_t:dispatch_block_cancel, \ dispatch_source_t:dispatch_source_cancel \ )((object)) Parameters
DiscussionType-generic macro that maps to dispatch_block_cancel or dispatch_source_cancel, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
DISPATCH_DATA_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DATA_DECL(name) typedef struct name_s *name_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, dispatch_object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. // OS_OBJECT_SWIFT3 #define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS(name, dispatch_object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL(name) \ typedef struct name##_s : public dispatch_object_s {} *name##_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL(name) typedef struct name##_s *name##_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_DECL_SUBCLASSAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, base) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_DECL_SUBCLASSAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS(name, base) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_DECL_SUBCLASSAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL_SUBCLASS(name, base) \ typedef struct name##_s : public base##_s {} *name##_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_DECL_SUBCLASSAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL_SUBCLASS(name, base) typedef base##_t name##_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_GLOBAL_OBJECTAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_GLOBAL_OBJECT(type, object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_GLOBAL_OBJECTAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_GLOBAL_OBJECT(type, object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_GLOBAL_OBJECTAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_GLOBAL_OBJECT(type, object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_notifySchedule a notification block to be submitted to a queue when the execution of a specified object has completed. #define dispatch_notify(object, queue, notification_block) \ _Generic((object), \ dispatch_block_t:dispatch_block_notify, \ dispatch_group_t:dispatch_group_notify \ )((object),(queue), (notification_block)) Parameters
DiscussionType-generic macro that maps to dispatch_block_notify or dispatch_group_notify, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, dispatch_object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, base) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. // OS_OBJECT_SWIFT3 #define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS(name, dispatch_object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS(name, base) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_GLOBAL_OBJECT(type, object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL(name) \ typedef struct name##_s : public dispatch_object_s {} *name##_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL_SUBCLASS(name, base) \ typedef struct name##_s : public base##_s {} *name##_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_GLOBAL_OBJECT(type, object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_RETURNS_RETAINED DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL(name) typedef struct name##_s *name##_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DECL_SUBCLASS(name, base) typedef base##_t name##_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_GLOBAL_OBJECT(type, object) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_RETURNS_RETAINED DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_SOURCE_TYPE_DECL(name) \ struct dispatch_source_type_s \ _dispatch_source_type_##name; \ OS_OBJECT_DECL_PROTOCOL(dispatch_source_##name, <OS_dispatch_source>); \ OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL( \ dispatch_source, dispatch_source_##name) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_SOURCE_DECL(name) \ typedef struct name_s *name_t; \ OS_OBJECT_DECL_PROTOCOL(name, <NSObject>); \ OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL(name, name) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_SOURCE_DECL(name) \ typedef struct name_s *name_t; DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_DATA_DECL(name) typedef struct name_s *name_t DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_SOURCE_TYPE_DECL(name) \ const struct dispatch_source_type_s \ _dispatch_source_type_##name DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_object_tIncrement the reference count of a dispatch object. #define dispatch_retain(object) \ __extension__({ dispatch_object_t _o = (object); \ _dispatch_object_validate(_o); (void)[_o retain]; }) ParametersDiscussionCalls to dispatch_retain() must be balanced with calls to dispatch_release(). See Also
dispatch_object_tDecrement the reference count of a dispatch object. #define dispatch_release(object) \ __extension__({ dispatch_object_t _o = (object); \ _dispatch_object_validate(_o); [_o release]; }) ParametersDiscussionA dispatch object is asynchronously deallocated once all references are released (i.e. the reference count becomes zero). The system does not guarantee that a given client is the last or only reference to a given object. See Also
dispatch_object_tWait synchronously for an object or until the specified timeout has elapsed. #define dispatch_wait(object, timeout) \ _Generic((object), \ dispatch_block_t:dispatch_block_wait, \ dispatch_group_t:dispatch_group_wait, \ dispatch_semaphore_t:dispatch_semaphore_wait \ )((object),(timeout)) Parameters
DiscussionType-generic macro that maps to dispatch_block_wait, dispatch_group_wait or dispatch_semaphore_wait, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_object_tSchedule a notification block to be submitted to a queue when the execution of a specified object has completed. #define dispatch_notify(object, queue, notification_block) \ _Generic((object), \ dispatch_block_t:dispatch_block_notify, \ dispatch_group_t:dispatch_group_notify \ )((object),(queue), (notification_block)) Parameters
DiscussionType-generic macro that maps to dispatch_block_notify or dispatch_group_notify, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_object_tCancel the specified object. #define dispatch_cancel(object) \ _Generic((object), \ dispatch_block_t:dispatch_block_cancel, \ dispatch_source_t:dispatch_source_cancel \ )((object)) Parameters
DiscussionType-generic macro that maps to dispatch_block_cancel or dispatch_source_cancel, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_object_tTest whether the specified object has been canceled #define dispatch_testcancel(object) \ _Generic((object), \ dispatch_block_t:dispatch_block_testcancel, \ dispatch_source_t:dispatch_source_testcancel \ )((object)) Parameters
DiscussionType-generic macro that maps to dispatch_block_testcancel or dispatch_source_testcancel, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_releaseDecrement the reference count of a dispatch object. #define dispatch_release(object) \ __extension__({ dispatch_object_t _o = (object); \ _dispatch_object_validate(_o); [_o release]; }) ParametersDiscussionA dispatch object is asynchronously deallocated once all references are released (i.e. the reference count becomes zero). The system does not guarantee that a given client is the last or only reference to a given object. See Also
dispatch_retainIncrement the reference count of a dispatch object. #define dispatch_retain(object) \ __extension__({ dispatch_object_t _o = (object); \ _dispatch_object_validate(_o); (void)[_o retain]; }) ParametersDiscussionCalls to dispatch_retain() must be balanced with calls to dispatch_release(). See Also
DISPATCH_RETURNS_RETAINEDAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_RETURNS_RETAINEDAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_RETURNS_RETAINED DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_RETURNS_RETAINEDAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_RETURNS_RETAINED DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_SOURCE_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_SOURCE_DECL(name) \ typedef struct name_s *name_t; \ OS_OBJECT_DECL_PROTOCOL(name, <NSObject>); \ OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL(name, name) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_SOURCE_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_SOURCE_DECL(name) \ typedef struct name_s *name_t; DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_SOURCE_TYPE_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_SOURCE_TYPE_DECL(name) \ struct dispatch_source_type_s \ _dispatch_source_type_##name; \ OS_OBJECT_DECL_PROTOCOL(dispatch_source_##name, <OS_dispatch_source>); \ OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL( \ dispatch_source, dispatch_source_##name) DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
DISPATCH_SOURCE_TYPE_DECLAbstract base type for all dispatch objects. The details of the type definition are language-specific. #define DISPATCH_SOURCE_TYPE_DECL(name) \ const struct dispatch_source_type_s \ _dispatch_source_type_##name DiscussionDispatch objects are reference counted via calls to dispatch_retain() and dispatch_release(). See Also
dispatch_testcancelTest whether the specified object has been canceled #define dispatch_testcancel(object) \ _Generic((object), \ dispatch_block_t:dispatch_block_testcancel, \ dispatch_source_t:dispatch_source_testcancel \ )((object)) Parameters
DiscussionType-generic macro that maps to dispatch_block_testcancel or dispatch_source_testcancel, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
dispatch_waitWait synchronously for an object or until the specified timeout has elapsed. #define dispatch_wait(object, timeout) \ _Generic((object), \ dispatch_block_t:dispatch_block_wait, \ dispatch_group_t:dispatch_group_wait, \ dispatch_semaphore_t:dispatch_semaphore_wait \ )((object),(timeout)) Parameters
DiscussionType-generic macro that maps to dispatch_block_wait, dispatch_group_wait or dispatch_semaphore_wait, depending on the type of the first argument. See documentation for these functions for more details. This function is unavailable for any other object type. See Also
|