]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/lock.h
xnu-344.23.tar.gz
[apple/xnu.git] / bsd / sys / lock.h
index 0e9783854c1dd95c4b7146b61e79f41b533ad166..de18dd2d19f9df3c6d852c0eff810544f986487d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
 
 #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_
@@ -95,6 +119,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 +243,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_ */