libXDispatch 0.6
include/libdispatch/queue.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-2009 Apple Inc. All rights reserved.
00003  *
00004  * @APPLE_APACHE_LICENSE_HEADER_START@
00005  * 
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  * 
00010  *     http://www.apache.org/licenses/LICENSE-2.0
00011  * 
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  * 
00018  * @APPLE_APACHE_LICENSE_HEADER_END@
00019  */
00020 
00021 #ifndef __DISPATCH_QUEUE__
00022 #define __DISPATCH_QUEUE__
00023 
00024 #ifndef __DISPATCH_INDIRECT__
00025 #error "Please #include <xdispatch/dispatch.h> instead of this file directly."
00026 #include "base.h" // for HeaderDoc
00027 #endif
00028 
00067 DISPATCH_DECL(dispatch_queue);
00068 
00075 DISPATCH_DECL(dispatch_queue_attr);
00076 
00110 #ifdef __BLOCKS__
00111 typedef void (^dispatch_block_t)(void);
00112 #endif
00113 
00114 __DISPATCH_BEGIN_DECLS
00115 
00144 #ifdef __BLOCKS__
00145 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00146 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
00147 void
00148 dispatch_async(dispatch_queue_t queue, dispatch_block_t block);
00149 #endif
00150 
00175 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00176 DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
00177 void
00178 dispatch_async_f(dispatch_queue_t queue,
00179        void *context,
00180        dispatch_function_t work);
00181 
00212 #ifdef __BLOCKS__
00213 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00214 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
00215 void
00216 dispatch_sync(dispatch_queue_t queue, dispatch_block_t block);
00217 #endif
00218 
00241 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00242 DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
00243 void
00244 dispatch_sync_f(dispatch_queue_t queue,
00245        void *context,
00246        dispatch_function_t work);
00247 
00273 #ifdef __BLOCKS__
00274 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00275 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
00276 void
00277 dispatch_apply(size_t iterations, dispatch_queue_t queue, void (^block)(size_t));
00278 #endif
00279 
00306 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00307 DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL4 DISPATCH_NOTHROW
00308 void
00309 dispatch_apply_f(size_t iterations, dispatch_queue_t queue,
00310        void *context,
00311        void (*work)(void *, size_t));
00312 
00328 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00329 DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
00330 dispatch_queue_t
00331 dispatch_get_current_queue(void);
00332 
00348 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00349 DISPATCH_EXPORT dispatch_queue_t dispatch_get_main_queue();
00350 
00371 enum {
00372        DISPATCH_QUEUE_PRIORITY_HIGH = 2,
00373        DISPATCH_QUEUE_PRIORITY_DEFAULT = 0,
00374        DISPATCH_QUEUE_PRIORITY_LOW = -2,
00375 };
00376 
00398 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00399 DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
00400 dispatch_queue_t
00401 dispatch_get_global_queue(long priority, unsigned long flags);
00402 
00427 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00428 DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_WARN_RESULT DISPATCH_NOTHROW
00429 dispatch_queue_t
00430 dispatch_queue_create(const char *label, dispatch_queue_attr_t attr);
00431 
00445 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00446 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
00447 const char *
00448 dispatch_queue_get_label(dispatch_queue_t queue);
00449 
00478 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00479 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
00480 void
00481 dispatch_set_target_queue(dispatch_object_t object, dispatch_queue_t queue);
00482 
00496 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00497 DISPATCH_EXPORT DISPATCH_NOTHROW DISPATCH_NORETURN
00498 void
00499 dispatch_main(void);
00500 
00523 #ifdef __BLOCKS__
00524 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00525 DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL3 DISPATCH_NOTHROW
00526 void
00527 dispatch_after(dispatch_time_t when,
00528        dispatch_queue_t queue,
00529        dispatch_block_t block);
00530 #endif
00531 
00557 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
00558 DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL4 DISPATCH_NOTHROW
00559 void
00560 dispatch_after_f(dispatch_time_t when,
00561        dispatch_queue_t queue,
00562        void *context,
00563        dispatch_function_t work);
00564 
00565 __DISPATCH_END_DECLS
00566 
00567 #endif

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