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 #ifndef __DISPATCH_SEMAPHORE__ 00024 #define __DISPATCH_SEMAPHORE__ 00025 00026 #ifndef __DISPATCH_INDIRECT__ 00027 #error "Please #include <dispatch/dispatch.h> instead of this file directly." 00028 #include <dispatch/base.h> // for HeaderDoc 00029 #endif 00030 00037 DISPATCH_DECL(dispatch_semaphore); 00038 00039 __DISPATCH_BEGIN_DECLS 00040 00060 DISPATCH_EXPORT dispatch_semaphore_t 00061 dispatch_semaphore_create(long value); 00062 00083 DISPATCH_EXPORT long 00084 dispatch_semaphore_wait(dispatch_semaphore_t dsema, dispatch_time_t timeout); 00085 00103 DISPATCH_EXPORT long 00104 dispatch_semaphore_signal(dispatch_semaphore_t dsema); 00105 00106 __DISPATCH_END_DECLS 00107 00108 #endif /* __DISPATCH_SEMAPHORE__ */