Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __DISPATCH_ONCE__
00022 #define __DISPATCH_ONCE__
00023
00024 #ifndef __DISPATCH_INDIRECT__
00025 #error "Please #include <xdispatch/dispatch.h> instead of this file directly."
00026 #include "base.h"
00027 #endif
00028
00029 __DISPATCH_BEGIN_DECLS
00030
00038 typedef intptr_t dispatch_once_t;
00039
00057 #ifdef __BLOCKS__
00058 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00059 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
00060 void
00061 dispatch_once(dispatch_once_t *predicate, dispatch_block_t block);
00062 #ifdef __GNUC__
00063 #define dispatch_once(x, ...) do { if (__builtin_expect(*(x), ~0l) != ~0l) dispatch_once((x), (__VA_ARGS__)); } while (0)
00064 #endif
00065 #endif
00066
00067 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00068 DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
00069 void
00070 dispatch_once_f(dispatch_once_t *predicate, void *context, void (*function)(void *));
00071 #ifdef __GNUC__
00072 #define dispatch_once_f(x, y, z) do { if (__builtin_expect(*(x), ~0l) != ~0l) dispatch_once_f((x), (y), (z)); } while (0)
00073 #endif
00074
00075 __DISPATCH_END_DECLS
00076
00077 #endif