X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..43866e378188c25dd1e2208016ab3cbeb086ae6c:/bsd/sys/lock.h diff --git a/bsd/sys/lock.h b/bsd/sys/lock.h index 0e9783854..c08bdc006 100644 --- a/bsd/sys/lock.h +++ b/bsd/sys/lock.h @@ -1,21 +1,24 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -61,8 +64,11 @@ #ifndef _SYS_LOCK_H_ #define _SYS_LOCK_H_ -#ifdef KERNEL +#include + +#ifdef KERNEL +#ifdef __APPLE_API_UNSTABLE #include #include @@ -71,6 +77,27 @@ #endif #define simple_lock_init(l) usimple_lock_init((l),0) +#if defined(simple_lock) +#undef simple_lock +#endif +#define simple_lock(l) ((void) 1) + +#if defined(simple_unlock) +#undef simple_unlock +#endif +#define simple_unlock(l) ((void) 1) + +#if defined(simple_lock_try) +#undef simple_lock_try +#endif +#define simple_lock_try(l) 1 + +#if defined(thread_sleep_simple_lock) +#undef thread_sleep_simple_lock +#endif +#define thread_sleep_simple_lock(l, e, i) thread_sleep_funnel((e), (i)) + +#endif /* __APPLE_API_UNSTABLE */ #else /* KERNEL */ #ifndef _MACHINE_SIMPLE_LOCK_DATA_ @@ -95,6 +122,8 @@ class simple_lock_data_t name; #endif /* _MACHINE_SIMPLE_LOCK_DATA_ */ #endif /* KERNEL */ + +#ifdef __APPLE_API_UNSTABLE /* * The general lock structure. Provides for multiple shared locks, * upgrading from shared to exclusive, and sleeping until the lock @@ -217,4 +246,6 @@ int lockmgr __P((struct lock__bsd__ *, u_int flags, simple_lock_t, struct proc *p)); int lockstatus __P((struct lock__bsd__ *)); +#endif /* __APPLE_API_UNSTABLE */ + #endif /* _SYS_LOCK_H_ */