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_QUEUE__
00022 #define __DISPATCH_QUEUE__
00023 
00029 #ifndef __DISPATCH_INDIRECT__
00030 #error "Please #include <dispatch/dispatch.h> instead of this file directly."
00031 #include "base.h" 
00032 #endif
00033 
00034 
00052 DISPATCH_DECL(dispatch_queue);
00053 
00057 DISPATCH_DECL(dispatch_queue_attr);
00058 
00088 #ifdef __BLOCKS__
00089 typedef void (^dispatch_block_t)(void);
00090 #endif
00091 
00092 __DISPATCH_BEGIN_DECLS
00093 
00118 #ifdef __BLOCKS__
00119 
00120 DISPATCH_EXPORT  
00121 void
00122 dispatch_async(dispatch_queue_t queue, dispatch_block_t block);
00123 #endif
00124 
00146 DISPATCH_EXPORT   
00147 void
00148 dispatch_async_f(dispatch_queue_t queue,
00149        void *context,
00150        dispatch_function_t work);
00151 
00178 #ifdef __BLOCKS__
00179 
00180 DISPATCH_EXPORT  
00181 void
00182 dispatch_sync(dispatch_queue_t queue, dispatch_block_t block);
00183 #endif
00184 
00204 DISPATCH_EXPORT   
00205 void
00206 dispatch_sync_f(dispatch_queue_t queue,
00207        void *context,
00208        dispatch_function_t work);
00209 
00231 #ifdef __BLOCKS__
00232 
00233 DISPATCH_EXPORT  
00234 void
00235 dispatch_apply(size_t iterations, dispatch_queue_t queue, void (^block)(size_t));
00236 #endif
00237 
00261 DISPATCH_EXPORT   
00262 void
00263 dispatch_apply_f(size_t iterations, dispatch_queue_t queue,
00264        void *context,
00265        void (*work)(void *, size_t));
00266 
00279 DISPATCH_EXPORT   
00280 dispatch_queue_t
00281 dispatch_get_current_queue(void);
00282 
00295 DISPATCH_EXPORT dispatch_queue_t dispatch_get_main_queue();
00296 
00300 enum {
00301     DISPATCH_QUEUE_PRIORITY_HIGH = 2, 
00306     DISPATCH_QUEUE_PRIORITY_DEFAULT = 0, 
00312     DISPATCH_QUEUE_PRIORITY_LOW = -2, 
00318 };
00319 
00338 DISPATCH_EXPORT   
00339 dispatch_queue_t
00340 dispatch_get_global_queue(long priority, unsigned long flags);
00341 
00363 DISPATCH_EXPORT   
00364 dispatch_queue_t
00365 dispatch_queue_create(const char *label, dispatch_queue_attr_t attr);
00366 
00378 DISPATCH_EXPORT    
00379 const char *
00380 dispatch_queue_get_label(dispatch_queue_t queue);
00381 
00407 DISPATCH_EXPORT  
00408 void
00409 dispatch_set_target_queue(dispatch_object_t object, dispatch_queue_t queue);
00410 
00423 DISPATCH_EXPORT  
00424 void
00425 dispatch_main(void);
00426 
00445 #ifdef __BLOCKS__
00446 
00447 DISPATCH_EXPORT   
00448 void
00449 dispatch_after(dispatch_time_t when,
00450        dispatch_queue_t queue,
00451        dispatch_block_t block);
00452 #endif
00453 
00476 DISPATCH_EXPORT   
00477 void
00478 dispatch_after_f(dispatch_time_t when,
00479        dispatch_queue_t queue,
00480        void *context,
00481        dispatch_function_t work);
00482 
00483 __DISPATCH_END_DECLS
00484 
00487 #endif