XDispatch 0.7.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
once.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_ONCE__
00022 #define __DISPATCH_ONCE__
00023 
00029 #ifndef __DISPATCH_INDIRECT__
00030 #error "Please #include <dispatch/dispatch.h> instead of this file directly."
00031 #include "base.h" // for HeaderDoc
00032 #endif
00033 
00034 __DISPATCH_BEGIN_DECLS
00035 
00040 typedef intptr_t dispatch_once_t;
00041 
00055 #ifdef __BLOCKS__
00056 
00057 DISPATCH_EXPORT  
00058 void
00059 dispatch_once(dispatch_once_t *predicate, dispatch_block_t block);
00060 #ifdef __GNUC__
00061 #define dispatch_once(x, ...) do { if (__builtin_expect(*(x), ~0l) != ~0l) dispatch_once((x), (__VA_ARGS__)); } while (0)
00062 #endif
00063 #endif
00064 
00065 
00066 DISPATCH_EXPORT   
00067 void
00068 dispatch_once_f(dispatch_once_t *predicate, void *context, void (*function)(void *));
00069 #ifdef __GNUC__
00070 #define dispatch_once_f(x, y, z) do { if (__builtin_expect(*(x), ~0l) != ~0l) dispatch_once_f((x), (y), (z)); } while (0)
00071 #endif
00072 
00073 __DISPATCH_END_DECLS
00074 
00077 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Sun Oct 28 2012 22:12:47 for XDispatch by Doxygen 1.7.6.1
© 2010-2012 MLBA (about | privacy) All Rights reserved.