]> git.saurik.com Git - apple/libc.git/blobdiff - fbsdcompat/spinlock.h
Libc-1439.100.3.tar.gz
[apple/libc.git] / fbsdcompat / spinlock.h
index 791d95265c825edb76c3c49341aca5b991f40301..b3417cebbc690ee8ed0bc71bac6b251ae2f482a0 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * 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
 #ifndef _SPINLOCK_H_
 #define _SPINLOCK_H_
 #ifdef __APPLE__
-#include <pthread_spinlock.h>
+#include <os/lock.h>
 
-typedef pthread_lock_t spinlock_t;
+typedef os_unfair_lock spinlock_t;
 
-#define        _SPINLOCK_INITIALIZER   LOCK_INITIALIZER
+#define        _SPINLOCK_INITIALIZER   OS_UNFAIR_LOCK_INIT
 
 #define        _SPINLOCK(_lck)                                                 \
     do {                                                               \
-       _DO_SPINLOCK_LOCK(_lck);                                        \
+       os_unfair_lock_lock(_lck);                                      \
     } while (0)
 
 #define _SPINUNLOCK(_lck)                                              \
     do {                                                               \
-       _DO_SPINLOCK_UNLOCK(_lck);                                      \
+       os_unfair_lock_unlock(_lck);                                    \
     } while (0)
 
 #else /* ! __APPLE__ */