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
00022
00023
00024 #ifndef __DISPATCH_QUEUE__
00025 #define __DISPATCH_QUEUE__
00026
00027 #ifndef __DISPATCH_INDIRECT__
00028 #error "Please #include <xdispatch/dispatch.h> instead of this file directly."
00029 #include "base.h"
00030 #endif
00031
00070 DISPATCH_DECL(dispatch_queue);
00071
00078 DISPATCH_DECL(dispatch_queue_attr);
00079
00113 #ifdef __BLOCKS__
00114 typedef void (dispatch_block_t)(void);
00115 #endif
00116
00117 __DISPATCH_BEGIN_DECLS
00118
00143 DISPATCH_EXPORT void
00144 dispatch_async_f(dispatch_queue_t queue,
00145 void *context,
00146 dispatch_function_t work);
00147
00148
00171 DISPATCH_EXPORT void
00172 dispatch_sync_f(dispatch_queue_t queue,
00173 void *context,
00174 dispatch_function_t work);
00175
00202 DISPATCH_EXPORT void
00203 dispatch_apply_f(size_t iterations, dispatch_queue_t queue,
00204 void *context,
00205 void (*work)(void *, size_t));
00206
00222 DISPATCH_EXPORT dispatch_queue_t
00223 dispatch_get_current_queue(void);
00224
00240 DISPATCH_EXPORT dispatch_queue_t dispatch_get_main_queue();
00241
00262 enum {
00263 DISPATCH_QUEUE_PRIORITY_HIGH = 2,
00264 DISPATCH_QUEUE_PRIORITY_DEFAULT = 0,
00265 DISPATCH_QUEUE_PRIORITY_LOW = -2,
00266 };
00267
00289 DISPATCH_EXPORT dispatch_queue_t
00290 dispatch_get_global_queue(long priority, unsigned long flags);
00291
00316 DISPATCH_EXPORT dispatch_queue_t
00317 dispatch_queue_create(const char *label, dispatch_queue_attr_t attr);
00318
00332 DISPATCH_EXPORT const char *
00333 dispatch_queue_get_label(dispatch_queue_t queue);
00334
00363 DISPATCH_EXPORT void
00364 dispatch_set_target_queue(dispatch_object_t object, dispatch_queue_t queue);
00365
00380 DISPATCH_EXPORT void
00381 dispatch_main(void);
00382
00408 DISPATCH_EXPORT void
00409 dispatch_after_f(dispatch_time_t when,
00410 dispatch_queue_t queue,
00411 void *context,
00412 dispatch_function_t work);
00413
00414 __DISPATCH_END_DECLS
00415
00416 #ifdef XDISPATCH_HAS_BLOCKS
00417
00447 DISPATCH_EXPORT void
00448 dispatch_async(dispatch_queue_t queue, dispatch_block_t block);
00449
00450
00474 DISPATCH_EXPORT void
00475 dispatch_after(dispatch_time_t when,
00476 dispatch_queue_t queue,
00477 dispatch_block_t block);
00478
00479
00511 DISPATCH_EXPORT void
00512 dispatch_sync(dispatch_queue_t queue, dispatch_block_t block);
00513
00540 DISPATCH_EXPORT void
00541 dispatch_apply(size_t iterations, dispatch_queue_t queue, dispatch_iteration_block_t block);
00542
00543 #endif
00544
00545 #endif