/*
- * 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@
*/
#ifndef _SYS_LOCK_H_
#define _SYS_LOCK_H_
-#ifdef KERNEL
+#include <sys/appleapiopts.h>
+
+#ifdef KERNEL
+#ifdef __APPLE_API_UNSTABLE
#include <kern/simple_lock.h>
#include <kern/simple_lock_types.h>
#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_
#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
simple_lock_t, struct proc *p));
int lockstatus __P((struct lock__bsd__ *));
+#endif /* __APPLE_API_UNSTABLE */
+
#endif /* _SYS_LOCK_H_ */