once.h
IntroductionUse the links in the table of contents to the left to access the documentation. Functions
DISPATCH_NONNULL3Execute a block once and only once. DISPATCH_NONNULL1 DISPATCH_NONNULL3 ( "Use lazily initialized globals instead") void _dispatch_once_f( dispatch_once_t *predicate, void *_Nullable context, dispatch_function_t function) ParametersDiscussionAlways call dispatch_once() before using or testing any variables that are initialized by the block. See Also dispatch_onceExecute a block once and only once. #if (defined( 1)) (macos( 10.6), ios( 4.0)) ( "Use lazily initialized globals instead") void dispatch_once( dispatch_once_t *predicate, DISPATCH_NOESCAPE dispatch_block_t block); #if ( DISPATCH_ONCE_INLINE_FASTPATH) ( "Use lazily initialized globals instead") void _dispatch_once(dispatch_once_t *predicate, DISPATCH_NOESCAPE dispatch_block_t block) { if (DISPATCH_EXPECT( *predicate, ~0l) != ~0l) { dispatch_once( predicate, block); } else { dispatch_compiler_barrier(); } DISPATCH_COMPILER_CAN_ASSUME( *predicate == ~0l); } #undef dispatch_once #define dispatch_once _dispatch_once #endif #endif // DISPATCH_ONCE_INLINE_FASTPATH ( macos( 10.6), ios( 4.0)) DISPATCH_NONNULL1 DISPATCH_NONNULL3 ( "Use lazily initialized globals instead") void dispatch_once_f( dispatch_once_t *predicate, void *_Nullable context, dispatch_function_t function); #if ( DISPATCH_ONCE_INLINE_FASTPATH) DISPATCH_NONNULL1 DISPATCH_NONNULL3 ( "Use lazily initialized globals instead") void _dispatch_once_f( dispatch_once_t *predicate, void *_Nullable context, dispatch_function_t function) #define dispatch_once_f _dispatch_once_f #endif // DISPATCH_ONCE_INLINE_FASTPATH DISPATCH_ASSUME_NONNULL_END #endif /* __DISPATCH_ONCE__ */ ParametersDiscussionAlways call dispatch_once() before using or testing any variables that are initialized by the block. See Also
Typedefs
dispatch_once_tA predicate for use with dispatch_once(). It must be initialized to zero. Note: static and global variables default to zero. ( "Use lazily initialized globals instead") typedef intptr_t dispatch_once_t; Macro Definitions
dispatch_onceExecute a block once and only once. #define dispatch_once_f _dispatch_once_f ParametersDiscussionAlways call dispatch_once() before using or testing any variables that are initialized by the block. See Also dispatch_once_fExecute a block once and only once. #define dispatch_once_f _dispatch_once_f ParametersDiscussionAlways call dispatch_once() before using or testing any variables that are initialized by the block. See Also |