libXDispatch 0.3.1
include/libdispatch/queue.h
Go to the documentation of this file.
00001 /*
00002 * Copyright (c) 2008-2009 Apple Inc. All rights reserved.
00003 * Copyright (c) 2011 MLBA. All rights reserved.
00004 *
00005 * @MLBA_OPEN_LICENSE_HEADER_START@
00006 *
00007 * Licensed under the Apache License, Version 2.0 (the "License");
00008 * you may not use this file except in compliance with the License.
00009 * You may obtain a copy of the License at
00010 * 
00011 *     http://www.apache.org/licenses/LICENSE-2.0
00012 * 
00013 * Unless required by applicable law or agreed to in writing, software
00014 * distributed under the License is distributed on an "AS IS" BASIS,
00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016 * See the License for the specific language governing permissions and
00017 * limitations under the License.
00018 *
00019 * @MLBA_OPEN_LICENSE_HEADER_END@
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" // for HeaderDoc
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

Generated on Wed Feb 22 2012 19:43:56 for libXDispatch by Doxygen 1.7.4
Content © 2011-2012 MLBA (about | privacy) – Design © 2010-2012 Emzeat. All Rights reserved.